Details

    • Similar Issues:

      Description

      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.

        Attachments

          Issue Links

            Activity

            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Oleg Nenashev
            Path:
            pom.xml
            http://jenkins-ci.org/commit/envinject-lib/b3f4b15f61af17399404627b5dd78078a3c43a7c
            Log:
            JENKINS-45055 - Enable FindBugs by default

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: pom.xml http://jenkins-ci.org/commit/envinject-lib/b3f4b15f61af17399404627b5dd78078a3c43a7c Log: JENKINS-45055 - Enable FindBugs by default
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Oleg Nenashev
            Path:
            src/main/java/org/jenkinsci/lib/envinject/EnvInjectAction.java
            src/main/java/org/jenkinsci/lib/envinject/service/EnvInjectActionRetriever.java
            src/main/java/org/jenkinsci/lib/envinject/service/EnvInjectSavable.java
            http://jenkins-ci.org/commit/envinject-lib/af1bcc6c6dcd38bfff53900a819e033a3ed52bf5
            Log:
            JENKINS-45055 - Cleanup issues reported by FindBugs

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: src/main/java/org/jenkinsci/lib/envinject/EnvInjectAction.java src/main/java/org/jenkinsci/lib/envinject/service/EnvInjectActionRetriever.java src/main/java/org/jenkinsci/lib/envinject/service/EnvInjectSavable.java http://jenkins-ci.org/commit/envinject-lib/af1bcc6c6dcd38bfff53900a819e033a3ed52bf5 Log: JENKINS-45055 - Cleanup issues reported by FindBugs
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Oleg Nenashev
            Path:
            src/main/java/org/jenkinsci/lib/envinject/EnvInjectAction.java
            src/main/java/org/jenkinsci/lib/envinject/EnvInjectException.java
            src/main/java/org/jenkinsci/lib/envinject/EnvInjectLogger.java
            http://jenkins-ci.org/commit/envinject-lib/62dc34b7745a924b516a303445d5b8af4d8751cd
            Log:
            JENKINS-45055 - Annotate other non-deprecated API methods

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: src/main/java/org/jenkinsci/lib/envinject/EnvInjectAction.java src/main/java/org/jenkinsci/lib/envinject/EnvInjectException.java src/main/java/org/jenkinsci/lib/envinject/EnvInjectLogger.java http://jenkins-ci.org/commit/envinject-lib/62dc34b7745a924b516a303445d5b8af4d8751cd Log: JENKINS-45055 - Annotate other non-deprecated API methods
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Oleg Nenashev
            Path:
            pom.xml
            src/main/java/org/jenkinsci/lib/envinject/EnvInjectAction.java
            src/main/java/org/jenkinsci/lib/envinject/EnvInjectException.java
            src/main/java/org/jenkinsci/lib/envinject/EnvInjectLogger.java
            src/main/java/org/jenkinsci/lib/envinject/service/EnvInjectActionRetriever.java
            src/main/java/org/jenkinsci/lib/envinject/service/EnvInjectSavable.java
            http://jenkins-ci.org/commit/envinject-lib/438588e27cdad7bdd78f3ee043094fa8c6b199ea
            Log:
            Merge pull request #10 from oleg-nenashev/JENKINS-45055-findbugs-cleanup

            JENKINS-45055 - FindBugs cleanup in EnvInject Lib

            Compare: https://github.com/jenkinsci/envinject-lib/compare/9e9ded81dc15...438588e27cda

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: pom.xml src/main/java/org/jenkinsci/lib/envinject/EnvInjectAction.java src/main/java/org/jenkinsci/lib/envinject/EnvInjectException.java src/main/java/org/jenkinsci/lib/envinject/EnvInjectLogger.java src/main/java/org/jenkinsci/lib/envinject/service/EnvInjectActionRetriever.java src/main/java/org/jenkinsci/lib/envinject/service/EnvInjectSavable.java http://jenkins-ci.org/commit/envinject-lib/438588e27cdad7bdd78f3ee043094fa8c6b199ea Log: Merge pull request #10 from oleg-nenashev/ JENKINS-45055 -findbugs-cleanup JENKINS-45055 - FindBugs cleanup in EnvInject Lib Compare: https://github.com/jenkinsci/envinject-lib/compare/9e9ded81dc15...438588e27cda
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            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

            Show
            oleg_nenashev Oleg Nenashev added a comment - 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
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Oleg Nenashev
            Path:
            pom.xml
            http://jenkins-ci.org/commit/envinject-plugin/1b5901413304a93091ec6c2caa78bfe0abbd6657
            Log:
            Reference JENKINS-45055 in FindBugs settings

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: pom.xml http://jenkins-ci.org/commit/envinject-plugin/1b5901413304a93091ec6c2caa78bfe0abbd6657 Log: Reference JENKINS-45055 in FindBugs settings
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            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

            Show
            oleg_nenashev Oleg Nenashev added a comment - 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
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            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
            
            Show
            oleg_nenashev Oleg Nenashev added a comment - 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

              People

              • Assignee:
                Unassigned
                Reporter:
                oleg_nenashev Oleg Nenashev
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: