-
Notifications
You must be signed in to change notification settings - Fork 14
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
[JENKINS-45055] Make EnvInject SpotBugs-clean #53
Comments
Code changed in jenkins |
Code changed in jenkins |
Code changed in jenkins |
Code changed in jenkins JENKINS-45055 - FindBugs cleanup in EnvInject Lib |
I have cleaned up EnvInject Lib and EnvInject API plugin, but somebody still needs to cleanup EnvInject Plugin itself. I have addressed some issues there, but there is still some work to do |
Code changed in jenkins |
Unfortunately I will not have time to work on EnvInject issues for a while. I decided to unassign all issues so that somebody can take them and finalize. Context: The plugin has been waiting for adoption for ~2 years. During all this time I was trying to keep this plugin afloat by reviewing the incoming pull requests, fixing defects and keeping the codebase up to date to simplify the handover. But I have not been using this plugin on my own so that such maintenance was a bit lame. I invite all active users to contribute to the plugin by taking ownership of this plugin and of EnvInject API. I am happy to provide any required knowledge transfers and do some assistance during the first months of maintenance |
Current state:
[INFO] --- spotbugs-maven-plugin:3.1.12:check (spotbugs) @ envinject --- [INFO] BugInstance size is 21 [INFO] Error size is 0 [INFO] Total bugs: 21 [ERROR] hudson.plugins.envfile.EnvFileBuildWrapper$DescriptorImpl.getDisplayName() may return null, but is declared @Nonnull [hudson.plugins.envfile.EnvFileBuildWrapper$DescriptorImpl] At EnvFileBuildWrapper.java:[line 43] NP_NONNULL_RETURN_VIOLATION [ERROR] hudson.plugins.setenv.SetEnvBuildWrapper$DescriptorImpl.getDisplayName() may return null, but is declared @Nonnull [hudson.plugins.setenv.SetEnvBuildWrapper$DescriptorImpl] At SetEnvBuildWrapper.java:[line 52] NP_NONNULL_RETURN_VIOLATION [ERROR] Unused field: org.jenkinsci.plugins.envinject.EnvInjectBuilder$1.val$resultVariables [org.jenkinsci.plugins.envinject.EnvInjectBuilder$1] In EnvInjectBuilder$1.java UUF_UNUSED_FIELD [ERROR] org.jenkinsci.plugins.envinject.EnvInjectGlobalPasswordWrapper$DescriptorImpl.getDisplayName() may return null, but is declared @Nonnull [org.jenkinsci.plugins.envinject.EnvInjectGlobalPasswordWrapper$DescriptorImpl] At EnvInjectGlobalPasswordWrapper.java:[line 42] NP_NONNULL_RETURN_VIOLATION [ERROR] org.jenkinsci.plugins.envinject.EnvInjectInfo is Serializable; consider declaring a serialVersionUID [org.jenkinsci.plugins.envinject.EnvInjectInfo] At EnvInjectInfo.java:[lines 27-86] SE_NO_SERIALVERSIONID [ERROR] org.jenkinsci.plugins.envinject.EnvInjectJobProperty.getPasswordEntries() may expose internal representation by returning EnvInjectJobProperty.passwordEntries [org.jenkinsci.plugins.envinject.EnvInjectJobProperty] At EnvInjectJobProperty.java:[line 227] EI_EXPOSE_REP [ERROR] org.jenkinsci.plugins.envinject.EnvInjectJobProperty.setContributors(EnvInjectJobPropertyContributor[]) may expose internal representation by storing an externally mutable object into EnvInjectJobProperty.contributors [org.jenkinsci.plugins.envinject.EnvInjectJobProperty] At EnvInjectJobProperty.java:[line 158] EI_EXPOSE_REP2 [ERROR] Class org.jenkinsci.plugins.envinject.EnvInjectJobPropertyInfo defines non-transient non-serializable instance field secureGroovyScript [org.jenkinsci.plugins.envinject.EnvInjectJobPropertyInfo] In EnvInjectJobPropertyInfo.java SE_BAD_FIELD [ERROR] org.jenkinsci.plugins.envinject.EnvInjectJobPropertyInfo is Serializable; consider declaring a serialVersionUID [org.jenkinsci.plugins.envinject.EnvInjectJobPropertyInfo] At EnvInjectJobPropertyInfo.java:[lines 35-123] SE_NO_SERIALVERSIONID [ERROR] org.jenkinsci.plugins.envinject.EnvInjectPasswordWrapper.setPasswordEntries(EnvInjectPasswordEntry[]) may expose internal representation by storing an externally mutable object into EnvInjectPasswordWrapper.passwordEntries [org.jenkinsci.plugins.envinject.EnvInjectPasswordWrapper] At EnvInjectPasswordWrapper.java:[line 114] EI_EXPOSE_REP2 [ERROR] envInjectPasswordEntry must be non-null but is marked as nullable [org.jenkinsci.plugins.envinject.EnvInjectPasswordWrapper$1] At EnvInjectPasswordWrapper.java:[lines 43-46] NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE [ERROR] envInjectPasswordEntry must be non-null but is marked as nullable [org.jenkinsci.plugins.envinject.EnvInjectPasswordWrapper$2] At EnvInjectPasswordWrapper.java:[lines 53-56] NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE [ERROR] req must be non-null but is marked as nullable [org.jenkinsci.plugins.envinject.EnvInjectPasswordWrapper$DescriptorImpl] At EnvInjectPasswordWrapper.java:[lines 296-304] NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE [ERROR] Found reliance on default encoding in org.jenkinsci.plugins.envinject.EnvInjectPasswordWrapper$EnvInjectPasswordsOutputStream.eol(byte[], int): new String(byte[], int, int) [org.jenkinsci.plugins.envinject.EnvInjectPasswordWrapper$EnvInjectPasswordsOutputStream] At EnvInjectPasswordWrapper.java:[line 237] DM_DEFAULT_ENCODING [ERROR] Found reliance on default encoding in org.jenkinsci.plugins.envinject.EnvInjectPasswordWrapper$EnvInjectPasswordsOutputStream.eol(byte[], int): String.getBytes() [org.jenkinsci.plugins.envinject.EnvInjectPasswordWrapper$EnvInjectPasswordsOutputStream] At EnvInjectPasswordWrapper.java:[line 241] DM_DEFAULT_ENCODING [ERROR] Possible null pointer dereference in org.jenkinsci.plugins.envinject.EnvInjectPluginAction.getIconFileName() due to return value of called method [org.jenkinsci.plugins.envinject.EnvInjectPluginAction, org.jenkinsci.plugins.envinject.EnvInjectPluginAction] Method invoked at EnvInjectPluginAction.java:[line 64]Known null at EnvInjectPluginAction.java:[line 64] NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE [ERROR] Possible null pointer dereference in org.jenkinsci.plugins.envinject.EnvInjectPluginAction.getTarget() due to return value of called method [org.jenkinsci.plugins.envinject.EnvInjectPluginAction, org.jenkinsci.plugins.envinject.EnvInjectPluginAction] Method invoked at EnvInjectPluginAction.java:[line 80]Known null at EnvInjectPluginAction.java:[line 80] NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE [ERROR] Possible null pointer dereference in org.jenkinsci.plugins.envinject.EnvInjectPluginAction.getUrlName() due to return value of called method [org.jenkinsci.plugins.envinject.EnvInjectPluginAction, org.jenkinsci.plugins.envinject.EnvInjectPluginAction] Method invoked at EnvInjectPluginAction.java:[line 72]Known null at EnvInjectPluginAction.java:[line 72] NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE [ERROR] Found reliance on default encoding in org.jenkinsci.plugins.envinject.EnvInjectVarList.writeJsonResponse(StaplerResponse): String.getBytes() [org.jenkinsci.plugins.envinject.EnvInjectVarList, org.jenkinsci.plugins.envinject.EnvInjectVarList, org.jenkinsci.plugins.envinject.EnvInjectVarList] At EnvInjectVarList.java:[line 128]Another occurrence at EnvInjectVarList.java:[line 134]Another occurrence at EnvInjectVarList.java:[line 135] DM_DEFAULT_ENCODING [ERROR] Found reliance on default encoding in org.jenkinsci.plugins.envinject.EnvInjectVarList.writeTextResponse(StaplerResponse): String.getBytes() [org.jenkinsci.plugins.envinject.EnvInjectVarList] At EnvInjectVarList.java:[line 112] DM_DEFAULT_ENCODING [ERROR] Found reliance on default encoding in org.jenkinsci.plugins.envinject.EnvInjectVarList.writeXmlResponse(StaplerResponse): String.getBytes() [org.jenkinsci.plugins.envinject.EnvInjectVarList, org.jenkinsci.plugins.envinject.EnvInjectVarList, org.jenkinsci.plugins.envinject.EnvInjectVarList] At EnvInjectVarList.java:[line 118]Another occurrence at EnvInjectVarList.java:[line 120]Another occurrence at EnvInjectVarList.java:[line 122] DM_DEFAULT_ENCODING |
There are plenty of FindBugs issues discovered in EnvInject Lib and EnvInject Plugin. Although not all of them lead to the real issues, it would be great to cleanup these defects.
Originally reported by oleg_nenashev, imported from: Make EnvInject SpotBugs-clean
The text was updated successfully, but these errors were encountered: