incorrect null tests in DefaultAdminCategoryService.java

Description

While researching for uses of NODE_CATEGORY_MEMBERSHIP_CHANGED_EVENT_UEI, I noticed that in opennms-webapp/src/main/java/org/opennms/web/svclayer/support/DefaultAdminCategoryService.java has two null checks that will always evaluate to true, because they are checking the wrong object.

Inside method performNodeEdit() for both the Add and Remove actions, after getting an OnmsCategory object 'category', they test if the object 'node' is null instead of 'category'.

Attached is a patch that adds a null check for 'node', and corrects the two 'category' null checks.

On a side note, there do not appear to be any unit tests for DefaultAdminCategoryService.

Acceptance / Success Criteria

None

Attachments

1

Lucidchart Diagrams

Activity

Show:

Benjamin Reed June 24, 2013 at 12:25 PM

merged to 1.12

Fixed

Details

Assignee

Reporter

Labels

Components

Fix versions

Priority

PagerDuty

Created May 29, 2013 at 11:28 PM
Updated January 27, 2017 at 4:21 PM
Resolved June 24, 2013 at 12:25 PM