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

Enable checking for NM category FindBugs warnings #4034

Merged
merged 31 commits into from Sep 2, 2017

Conversation

Projects
None yet
2 participants
@rhwood
Contributor

rhwood commented Aug 31, 2017

Also address all NM category FindBugs warnings.

rhwood added some commits Aug 31, 2017

Merge branch 'master' of https://github.com/JMRI/JMRI into findbugs-nm
* 'master' of https://github.com/JMRI/JMRI:
  Emergency fix for conflicting PRs.
  Use separate titles for Transit Add and Edit frames, update all languages Update Transit help screen shots Fix help hyperlink to Dispatcher
  Add Dispatcher to sidebars/Automation
  Add Transits help landing page, add to Sidebars Add link from table help back to landing help intro
  Complete Add Section screen shot
  Add new Section screen shot Add links to Help from tools to package pages
  Use combo boxes to select Section sensors Clean up layout of Section, Transit and LRoute add/edit panes (auto system name at top) Expand Section - Block drop down tooltip to explain short list (Paths) Use separate titles for Add and Edit Properties for all languages split
  Use JSpinner for Route delay Set title of Edit Route pane, update help screen shot, move to images folder
  Add JSpinners to Edit Block tabs Sensor and Physical (length) Update help screen shots
  Fix test for renamed button
  Add some error messages to Add New Memory status bar
  Update Block and Memory help pages with new screen shot Use Create button instead of OK to match other beans
  Add status bar for Add New Blocks and Memorie Rename help bundle key
  Update Add New Block title and help page

# Conflicts:
#	java/test/jmri/jmrit/beantable/AddNewBeanPanelTest.java
Make inner class really be inner.
Per http://docs.oracle.com/javase/specs/jls/se7/html/jls-3.html#jls-3.8 the dollar sign should only be used in classes that are mechanically generated.
Rename methods to address FindBugs warnings.
Also handle other IDE warnings.
Merge branch 'master' of https://github.com/JMRI/JMRI into findbugs-nm
* 'master' of https://github.com/JMRI/JMRI:
  Fix bad link in Javadocs.
  Fix over-aggressive removal of duplicate constants.
  Fix Javadoc errors.
  Justify warning suppression
  Use JUnitUtil.setUp/tearDown helpers
  use new boilerplate for setup/teardown
  add name to JmriJFrame
  missed headless check
  new test
  new tests; convert package test to JUnit4
  new test. Convert package test to JUnit4
  Minor cleanup.
  Remove OBE class.
  Remove deprecated and no-longer-used in JMRI classes. - Also remove their tests.
Address FindBugs NM category warnings.
Also address IDE warnings in those classes with NM warnings.
Address FindBugs NM category warnings.
Also address some IDE warnings in flagged classes.

@rhwood rhwood added the WIP label Aug 31, 2017

@rhwood rhwood self-assigned this Aug 31, 2017

@rhwood

This comment has been minimized.

Show comment
Hide comment
@rhwood

rhwood Aug 31, 2017

Contributor

Marking WIP since this causes some high priority warnings.

Contributor

rhwood commented Aug 31, 2017

Marking WIP since this causes some high priority warnings.

@rhwood

This comment has been minimized.

Show comment
Hide comment
@rhwood

rhwood Sep 1, 2017

Contributor

@silverailscolo I had to change the name of a class used in SwitchboardEditor persistence; its name violated the Java specification and FindBugs could not find it to evaluate. Can you test to see if I need to provide a migration for that from existing XML files?

Contributor

rhwood commented Sep 1, 2017

@silverailscolo I had to change the name of a class used in SwitchboardEditor persistence; its name violated the Java specification and FindBugs could not find it to evaluate. Can you test to see if I need to provide a migration for that from existing XML files?

@silverailscolo

This comment has been minimized.

Show comment
Hide comment
@silverailscolo

silverailscolo Sep 1, 2017

Contributor

Will check this tonight GMT+1

Contributor

silverailscolo commented Sep 1, 2017

Will check this tonight GMT+1

rhwood added some commits Sep 1, 2017

Make DefaultWebServerConfiguration final.
This class triggers a UI_INHERITANCE_UNSAFE_GETRESOURCE warning due to how it loads resources. Making this class final addresses this since this is a concrete implementation of an abstract class. The creation and use of alternate WebServerConfiguration classes are not blocked by making this final.
Address a number of NM category bad practice FindBugs warnings.
Also address some other IDE-flagged warnings.
*PopUp -> *Popup and *Tooltip -> *ToolTip
- Addresses FindBugs "confusing names" warnings
- Changes only in Java sources, not in properties files
AllEntries() -> allEntries() in Roster.
Addresses FindBugs warning.

rhwood added some commits Sep 2, 2017

Merge branch 'master' of https://github.com/JMRI/JMRI into findbugs-nm
* 'master' of https://github.com/JMRI/JMRI: (22 commits)
  mimic production and send null hash maps.
  set correct type names
  Improve Conditional Tree Navigation
  put something in the hashmaps
  new tests
  new test
  new tests
  Protect names of NamedBeans - User name can only be set using setUserName() - System name is immutable
  Remove only setting of mSystemName in AbstractNamedBean outside its constructor. Also address some Javadoc and other warnings.
  Add all thrown exceptions to throws in method declaration.
  Do not retain a second copy of the system name. - Automatically generate the system name if needed ASAP - Remove uniqueId which masked that non-unique SystemNames could be generated, which violates the NamedBean contract.
  Do not provide a private field mSystemName. - Do not override mSystemName in AbstractNamedBean with a separate instance. - Remove overriding methods that are duplicates of the overridden method. - Address Javadoc warnings. - Remove commented out dead code.
  Ensure the system name is not null. Since NamedBean.getSystemName() is documented in the NamedBean interface as never being null, do not allow the system name in an AbstractNamedBean to be null to adhere to that contract.
  Tear down windows opened by files without logging that fact.
  Normalize user names in a NamedBean class that does not extend AbstractNamedBean.
  Remove setters for non-existant properties.
  make button caption unique.  Please enter the commit message for your changes. Lines starting
  Restore normalization of user names in all cases. Consolidate property change support to a single class instead of repeatedly overriding it with identical methods (this prevents any issues calling on property change support within the AbstractNamedBean constructor).
  Deal with an intermittent timing issue in tests.
  Make test button do a back and forth and report on results Remove some code that had been commented out eons ago
  ...

# Conflicts:
#	java/src/jmri/jmrit/dispatcher/DispatcherFrame.java
#	java/src/jmri/jmrit/signalling/entryexit/DestinationPoints.java
#	java/src/jmri/jmrix/lenz/XNetLight.java

@rhwood rhwood removed the WIP label Sep 2, 2017

@rhwood rhwood merged commit 1e119b7 into JMRI:master Sep 2, 2017

4 checks passed

VersionEye All software dependencies are fine. You are awesome!
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.004%) to 35.687%
Details

rhwood added a commit to JMRI/website that referenced this pull request Sep 2, 2017

@silverailscolo

This comment has been minimized.

Show comment
Hide comment
@silverailscolo

silverailscolo Sep 2, 2017

Contributor

Thanks @rhwood for adding the migration. Sorry my setting up a test took longer.
Testing OK from your branch, loading my old set of Switchboards and other panels, also via Web Server.

Contributor

silverailscolo commented Sep 2, 2017

Thanks @rhwood for adding the migration. Sorry my setting up a test took longer.
Testing OK from your branch, loading my old set of Switchboards and other panels, also via Web Server.

@rhwood rhwood deleted the rhwood:findbugs-nm branch Sep 3, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment