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

Cleanup the code #16

Merged
merged 1 commit into from Dec 26, 2017

Conversation

Projects
None yet
2 participants
@oleg-nenashev
Copy link
Member

oleg-nenashev commented Dec 26, 2017

Just a minor cleanup, which I want to deliver as a part of #15

  • - Use try-with-resource
  • - squash similar exceptions
  • - Fix confusing reflection specification in EnvInjectActionRetriever

@Jimilian @jenkinsci/code-reviewers

Cleanup the code
- [x] - Use try-with-resource
- [x] - squash similar exceptions
- [x] - Fix confusing reflection specification in EnvInjectActionRetriever
@@ -23,15 +25,15 @@
//Returns the abstract class Action due to a class loading issue
//with EnvInjectAction subclasses. Subclasses cannot be casted from
//all point of Jenkins (classes are not loaded in some points)
public Action getEnvInjectAction(AbstractBuild<?, ?> build) {
public Action getEnvInjectAction(@Nonnull AbstractBuild<?, ?> build) {
List<Action> actions;
if (build == null) {

This comment has been minimized.

Copy link
@Jimilian

Jimilian Dec 26, 2017

Contributor

If build is non-nullable now this line can be removed.

This comment has been minimized.

Copy link
@oleg-nenashev

oleg-nenashev Dec 26, 2017

Author Member

It's a legacy API issue, some plugins were trying to call it. That's why I keep NPE explicit

@Jimilian

This comment has been minimized.

Copy link
Contributor

Jimilian commented Dec 26, 2017

Looks good for me, but I can't vote

@oleg-nenashev oleg-nenashev merged commit 04b6f8e into jenkinsci:master Dec 26, 2017

@oleg-nenashev oleg-nenashev deleted the oleg-nenashev:code-cleanup branch Dec 26, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.