Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactored some static factory methods into secondary constructors. #1325

Merged
merged 1 commit into from
Apr 17, 2024

Conversation

odisseus
Copy link
Contributor

@odisseus odisseus commented Apr 16, 2024

If the factory method just accepts a different list of arguments, it should be a constructor.

Test plan

No change in functionality – no new tests needed?

@odisseus odisseus marked this pull request as ready for review April 17, 2024 12:40
@@ -3,7 +3,10 @@ package com.sourcegraph.cody.history.state
import com.intellij.openapi.components.BaseState
import com.intellij.util.xmlb.annotations.OptionTag

class AccountData : BaseState() {
class AccountData() : BaseState() {
constructor(accountId: String) : this() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow, I was not aware we can do this in Kotlin

Copy link
Contributor

@mkondratek mkondratek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@odisseus odisseus merged commit 1b9fd9a into main Apr 17, 2024
9 checks passed
@odisseus odisseus deleted the mg/refactoring branch April 17, 2024 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants