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.
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.