-
Notifications
You must be signed in to change notification settings - Fork 136
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
Implement setters instead of constructor for optional parameters #246
Merged
scaytrase
merged 6 commits into
jenkinsci:release/1.x
from
westarne:feature/optional-parameters
Jan 22, 2022
Merged
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
d34dbce
Implement setters instead of constructor for optional parameters
fc16285
Merge branch 'release/1.x' into feature/optional-parameters
westarne 615d351
Optimize setters
ed5bde5
Remove unnecessary constructor
e3c5982
Merge branch 'release/1.x' into feature/optional-parameters
westarne a6e1355
Fix missing brace
westarne File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
src/main/resources/org/jenkinsci/plugins/stashNotifier/StashNotifier/help-buildName.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<div> | ||
If not empty, this will overwrite the default build name sent to Bitbucket. | ||
</div> |
3 changes: 3 additions & 0 deletions
3
src/main/resources/org/jenkinsci/plugins/stashNotifier/StashNotifier/help-buildStatus.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<div> | ||
If not empty, this status will be sent to Bitbucket instead of the <code>currentBuild.result</code>. | ||
</div> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am thinking if the number of constructors can be reduced even more? Is this one really required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about that, and neither am I that the test cases existing as well as the ones I can do locally cover all potential use cases. So I've kept it to be on the safe side.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But this is a new one and another one has been removed.
In other plugins it's often handled the way to keep all old constructors for backward compatibility and annotate them with
@Deprecated
. That's something the maintainers should decide.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh you're right. Then I'm not totally sure, what the constructor was meant for. I think it's just the old
DataBoundConstructor
without all of the optional parameters. So I could just move the logic in the no-argument constructor.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was some time out of the country and noticed that I did not push the change before. Done that now.