Fix a theoretical IM_BAD_CHECK_FOR_ODD 07/83907/2
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 22 Aug 2019 13:02:53 +0000 (15:02 +0200)
committerRobert Varga <nite@hq.sk>
Thu, 22 Aug 2019 15:04:53 +0000 (15:04 +0000)
While the size of a collection cannot be negative, this keeps
SpotBugs happy about the check.

Change-Id: Ic84a9f147b9d933efc66766617f6271fcf1eddc1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/path/PathExpressionParser.java

index b42d41d995c20f9541994dc0e196a4cf2c5624f8..e02e6fce25d1cc1c5e1add405266ab2678c26cd6 100644 (file)
@@ -100,7 +100,7 @@ class PathExpressionParser {
         final List<Step> steps = new ArrayList<>();
 
         final int relativeChildren = relative.getChildCount();
-        verify(relativeChildren % 2 == 1, "Unexpected child count %s", relativeChildren);
+        verify(relativeChildren % 2 != 0, "Unexpected child count %s", relativeChildren);
         for (int i = 0; i < relativeChildren / 2; ++i) {
             steps.add(YangXPathAxis.PARENT.asStep());
         }