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

Fix spotbug findings #68

Merged
merged 7 commits into from
Sep 7, 2023
Merged

Fix spotbug findings #68

merged 7 commits into from
Sep 7, 2023

Conversation

ErikRehmTT
Copy link
Collaborator

resolves #64

@ErikRehmTT ErikRehmTT self-assigned this Sep 5, 2023
Copy link
Contributor

@MartinGroscheTT MartinGroscheTT left a comment

Choose a reason for hiding this comment

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

Seems like that the 'generated' folder is scanned as well. See 'spotbugsMain-analyse-class-file.txt'

@@ -43,6 +43,14 @@ abstract class AbstractTestBuilder implements Serializable {
this.context = context
}

ExecutionConfig getExecutionConfig() {
return executionConfig? new ExecutionConfig(executionConfig) : null
Copy link
Contributor

Choose a reason for hiding this comment

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

format -> return executionConfig ? new ExecutionConfig(executionConfig) : null
and L51

@@ -10,6 +10,7 @@ import hudson.Extension
import hudson.model.AbstractDescribableImpl
import hudson.model.Descriptor
import hudson.util.FormValidation
import org.apache.tools.ant.taskdefs.Exec
Copy link
Contributor

Choose a reason for hiding this comment

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

probably unused

@@ -29,6 +29,11 @@ class Constant extends AbstractDescribableImpl<Constant> implements ExpandableCo
this.value = StringUtils.trimToEmpty(value)
}

Constant(Constant constant) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Couldn't we use the props and instantiate a new object instead of adding a new constructor
new Constant(oldConst.getLabel(), olConst.getValue)
Same for AdditionalSettings and *Configs

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We agreed on using copy constructors :)

@ErikRehmTT
Copy link
Collaborator Author

Seems like that the 'generated' folder is scanned as well. See 'spotbugsMain-analyse-class-file.txt'

Yes seems like its not possible to disable the scanning completly (even tried the task options). But issues found there, are not reported as there are exclude filters for those packages.

@ErikRehmTT ErikRehmTT merged commit 551b562 into main Sep 7, 2023
17 checks passed
@ErikRehmTT ErikRehmTT deleted the i64_fix-spotbugs-findings branch September 7, 2023 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix Spotbugs Findings
2 participants