Skip to content

Check warnings #143

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

Closed
chcg opened this issue Mar 19, 2024 · 1 comment · Fixed by #171
Closed

Check warnings #143

chcg opened this issue Mar 19, 2024 · 1 comment · Fixed by #171

Comments

@chcg
Copy link

chcg commented Mar 19, 2024

What feature do you want to see added?

There are multiple warnings visible within CI build, see e.g. https://ci.jenkins.io/job/Plugins/job/JiraTestResultReporter-plugin/job/master/51/console

16:36:43 [ERROR] Medium: org.jenkinsci.plugins.JiraTestResultReporter.JiraTestDataPublisher$JiraTestDataPublisherDescriptor.templates is a mutable collection which should be package protected [org.jenkinsci.plugins.JiraTestResultReporter.JiraTestDataPublisher$JiraTestDataPublisherDescriptor] At JiraTestDataPublisher.java:[line 367] MS_MUTABLE_COLLECTION_PKGPROTECT
16:36:43 [ERROR] Medium: Possible null pointer dereference of jiraPublisherJSON in org.jenkinsci.plugins.JiraTestResultReporter.JiraTestDataPublisher$JiraTestDataPublisherDescriptor.validateFieldConfigs(String) [org.jenkinsci.plugins.JiraTestResultReporter.JiraTestDataPublisher$JiraTestDataPublisherDescriptor, org.jenkinsci.plugins.JiraTestResultReporter.JiraTestDataPublisher$JiraTestDataPublisherDescriptor, org.jenkinsci.plugins.JiraTestResultReporter.JiraTestDataPublisher$JiraTestDataPublisherDescriptor] Dereferenced at JiraTestDataPublisher.java:[line 646]Null value at JiraTestDataPublisher.java:[line 636]Known null at JiraTestDataPublisher.java:[line 638] NP_NULL_ON_SOME_PATH
16:36:43 [ERROR] Medium: Redundant nullcheck of uri, which is known to be non-null in org.jenkinsci.plugins.JiraTestResultReporter.JiraTestDataPublisher$JiraTestDataPublisherDescriptor.doValidateGlobal(String, String, String) [org.jenkinsci.plugins.JiraTestResultReporter.JiraTestDataPublisher$JiraTestDataPublisherDescriptor] Redundant null check at JiraTestDataPublisher.java:[line 544] RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE
16:36:43 [ERROR] Medium: org.jenkinsci.plugins.JiraTestResultReporter.JiraTestDataPublisher$JiraTestDataPublisherDescriptor.validateFieldConfigs(String) makes inefficient use of keySet iterator instead of entrySet iterator [org.jenkinsci.plugins.JiraTestResultReporter.JiraTestDataPublisher$JiraTestDataPublisherDescriptor] At JiraTestDataPublisher.java:[line 640] WMI_WRONG_MAP_ITERATOR
16:36:43 [ERROR] High: Private readResolve method in org.jenkinsci.plugins.JiraTestResultReporter.JobConfigMapping$JobConfigEntry not inherited by subclasses. [org.jenkinsci.plugins.JiraTestResultReporter.JobConfigMapping$JobConfigEntry] At JobConfigMapping.java:[lines 118-119] SE_PRIVATE_READ_RESOLVE_NOT_INHERITED
16:36:43 [ERROR] Medium: Exception is caught when Exception is not thrown in org.jenkinsci.plugins.JiraTestResultReporter.TestToIssueMapping.saveMap(Job, HashMap) [org.jenkinsci.plugins.JiraTestResultReporter.TestToIssueMapping] At TestToIssueMapping.java:[line 77] REC_CATCH_EXCEPTION
16:36:43 [ERROR] Medium: Possible null pointer dereference in org.jenkinsci.plugins.JiraTestResultReporter.api.TestToIssueMappingApi.doJson(StaplerRequest, StaplerResponse) due to return value of called method [org.jenkinsci.plugins.JiraTestResultReporter.api.TestToIssueMappingApi, org.jenkinsci.plugins.JiraTestResultReporter.api.TestToIssueMappingApi] Dereferenced at TestToIssueMappingApi.java:[line 53]Known null at TestToIssueMappingApi.java:[line 50] NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE
16:36:43 [ERROR] High: Nullcheck of item at line 53 of value previously dereferenced in org.jenkinsci.plugins.JiraTestResultReporter.api.TestToIssueMappingApi.doJson(StaplerRequest, StaplerResponse) [org.jenkinsci.plugins.JiraTestResultReporter.api.TestToIssueMappingApi, org.jenkinsci.plugins.JiraTestResultReporter.api.TestToIssueMappingApi] At TestToIssueMappingApi.java:[line 53]Redundant null check at TestToIssueMappingApi.java:[line 55] RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE
16:36:43 [ERROR] Medium: org.jenkinsci.plugins.JiraTestResultReporter.config.SelectableArrayFields$SelectableArrayFieldsDescriptor.doFillValueItems(String, String, String) might ignore java.lang.Exception [org.jenkinsci.plugins.JiraTestResultReporter.config.SelectableArrayFields$SelectableArrayFieldsDescriptor, org.jenkinsci.plugins.JiraTestResultReporter.config.SelectableArrayFields$SelectableArrayFieldsDescriptor] At SelectableArrayFields.java:[line 164]At SelectableArrayFields.java:[line 164] DE_MIGHT_IGNORE
16:36:43 [ERROR] Medium: Exception is caught when Exception is not thrown in org.jenkinsci.plugins.JiraTestResultReporter.config.SelectableArrayFields$SelectableArrayFieldsDescriptor.doFillValueItems(String, String, String) [org.jenkinsci.plugins.JiraTestResultReporter.config.SelectableArrayFields$SelectableArrayFieldsDescriptor] At SelectableArrayFields.java:[line 164] REC_CATCH_EXCEPTION
16:36:43 [ERROR] Medium: org.jenkinsci.plugins.JiraTestResultReporter.config.UserFields is Serializable; consider declaring a serialVersionUID [org.jenkinsci.plugins.JiraTestResultReporter.config.UserFields] At UserFields.java:[lines 36-70] SE_NO_SERIALVERSIONID
16:36:43 [ERROR] Medium: org.jenkinsci.plugins.JiraTestResultReporter.restclientextensions.FullStatus defines equals but not hashCode [org.jenkinsci.plugins.JiraTestResultReporter.restclientextensions.FullStatus] At FullStatus.java:[lines 48-52] HE_EQUALS_NO_HASHCODE

at least they should be analysed and maybe fixed.

Upstream changes

No response

Are you interested in contributing this feature?

No response

@chcg
Copy link
Author

chcg commented Oct 23, 2024

Currently open compiler issues from https://ci.jenkins.io/job/Plugins/job/JiraTestResultReporter-plugin/job/master/69/console :

08:24:17  [WARNING] /home/jenkins/agent/workspace/TestResultReporter-plugin_master/src/main/java/org/jenkinsci/plugins/JiraTestResultReporter/config/SelectableArrayFields.java:[169,60] non-varargs call of varargs method with inexact argument type for last parameter;
08:24:17    cast to java.lang.Object for a varargs call
08:24:17    cast to java.lang.Object[] for a non-varargs call and to suppress this warning
08:24:17  [INFO] /home/jenkins/agent/workspace/TestResultReporter-plugin_master/src/main/java/org/jenkinsci/plugins/JiraTestResultReporter/JiraTestAction.java: Some input files use or override a deprecated API.
08:24:17  [INFO] /home/jenkins/agent/workspace/TestResultReporter-plugin_master/src/main/java/org/jenkinsci/plugins/JiraTestResultReporter/JiraTestAction.java: Recompile with -Xlint:deprecation for details.
08:24:17  [INFO] /home/jenkins/agent/workspace/TestResultReporter-plugin_master/src/main/java/org/jenkinsci/plugins/JiraTestResultReporter/JiraTestDataPublisher.java: Some input files use unchecked or unsafe operations.
08:24:17  [INFO] /home/jenkins/agent/workspace/TestResultReporter-plugin_master/src/main/java/org/jenkinsci/plugins/JiraTestResultReporter/JiraTestDataPublisher.java: Recompile with -Xlint:unchecked for details.

chcg added a commit to chcg/JiraTestResultReporter-plugin that referenced this issue Oct 23, 2024
08:24:17  [WARNING] /home/jenkins/agent/workspace/TestResultReporter-plugin_master/src/main/java/org/jenkinsci/plugins/JiraTestResultReporter/config/SelectableArrayFields.java:[169,60] non-varargs call of varargs method with inexact argument type for last parameter;
08:24:17    cast to java.lang.Object for a varargs call
08:24:17    cast to java.lang.Object[] for a non-varargs call and to suppress this warning
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant