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

Rj cleanup ide warnings and code formatting #163

Merged

Conversation

rjoachim
Copy link

First batch of changes to clean up warnings of eclipse IDE and improve code formatting. Patch does not change internal logic.

if (o == null) return false;
if (o == null) {
return false;
}
Copy link
Member

Choose a reason for hiding this comment

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

This addition is causing a spot bugs error in the build:

[INFO] org.openlcb.swing.NodeSelector$ModelEntry defines equals and uses Object.hashCode() [org.openlcb.swing.NodeSelector$ModelEntry] At NodeSelector.java:[lines 169-178] HE_EQUALS_USE_HASHCODE
335[INFO]

The next line Includes an instanceof operator. Instanceof returns false for null, so the null case is already handled.

Copy link
Author

Choose a reason for hiding this comment

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

Removed null check in equals() as requested. Also added hashCode() to potentially fix spot bugs warning.
Could you please give me a hint on how to execute spot bugs to prevent such warnings on future changes?

Copy link
Member

Choose a reason for hiding this comment

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

Spogbugs is run on travis using the following Maven command:

mvn clean verify -U -P spotbugs --batch-mode -Dmaven.javadoc.skip=true

@coveralls
Copy link

Coverage Status

Coverage increased (+0.006%) to 71.826% when pulling ca40379 on rjoachim:rj-cleanup_ide_warnings_and_code_formatting into 19642dd on openlcb:master.

@pabender pabender merged commit 01b5e0f into openlcb:master Mar 30, 2020
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.

None yet

3 participants