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

Code clean-up #185

Merged
merged 9 commits into from
Jan 12, 2022
Merged

Code clean-up #185

merged 9 commits into from
Jan 12, 2022

Conversation

offa
Copy link
Contributor

@offa offa commented Dec 8, 2021

Some code clean-up and removal of JSR 305.


  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

@offa
Copy link
Contributor Author

offa commented Dec 8, 2021

For someone more experienced in the subject: Are adding final and using lambdas instead of anonymous classes safe here?

@timja timja requested a review from a team January 10, 2022 13:03
@jglick
Copy link
Member

jglick commented Jan 10, 2022

Are adding final and using lambdas instead of anonymous classes safe here?

In general, yes. You need to be careful with any classes that might be serialized.

#190 should cover most of the diff here. Sorry about the PR review/merge backlog.

@offa
Copy link
Contributor Author

offa commented Jan 11, 2022

I have dropped the JSR changes; conflicts resolved.

Copy link
Member

@jglick jglick left a comment

Choose a reason for hiding this comment

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

Looks good, thanks! Left a few very minor comments—feel free to ignore. Sorry about the long delay and the merge conflicts.

dstDir.child(path).copyFrom(in);
} finally {
IOUtils.closeQuietly(in);
Copy link
Member

Choose a reason for hiding this comment

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

Fix imports?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are no unused imports left or do you mean reordering / grouping?

Copy link
Member

Choose a reason for hiding this comment

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

I did not check, I just guessed that IOUtils became unused.

@jglick jglick added the chore label Jan 11, 2022
@offa
Copy link
Contributor Author

offa commented Jan 11, 2022

No problem. Thanks for the suggestions. 👍

@jglick jglick changed the title Code clean-up / remove JSR 305 Code clean-up Jan 12, 2022
@jglick jglick merged commit 5e24327 into jenkinsci:master Jan 12, 2022
@offa offa deleted the dev branch January 12, 2022 18:30
@@ -109,7 +109,7 @@ public FlowDurabilityHint getDurabilityHint() {
/**
* Should be called by the flow owner after it is deserialized.
*/
public /*abstract*/ void onLoad(FlowExecutionOwner owner) throws IOException {
Copy link
Member

@dwnusbaum dwnusbaum Feb 16, 2022

Choose a reason for hiding this comment

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

Changes to throws clauses like this break source compatibility with CpsFlowExecution in https://github.com/jenkinsci/workflow-cps-plugin and need to be reverted:

-------------------------------------------------------------
COMPILATION ERROR : 
-------------------------------------------------------------
workflow-cps-plugin/src/main/java/org/jenkinsci/plugins/workflow/cps/CpsFlowExecution.java:[721,17] onLoad(org.jenkinsci.plugins.workflow.flow.FlowExecutionOwner) in org.jenkinsci.plugins.workflow.cps.CpsFlowExecution cannot override onLoad(org.jenkinsci.plugins.workflow.flow.FlowExecutionOwner) in org.jenkinsci.plugins.workflow.flow.FlowExecution
  overridden method does not throw java.io.IOException
1 error
-------------------------------------------------------------

Copy link
Member

Choose a reason for hiding this comment

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

Indeed this is wrong and should be reverted.

Copy link
Member

Choose a reason for hiding this comment

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

@dwnusbaum if you approve #201 I can cut a release to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants