sdedic commented on a change in pull request #2610:
URL: https://github.com/apache/netbeans/pull/2610#discussion_r578430210



##########
File path: 
java/java.hints/src/org/netbeans/modules/java/hints/perf/SizeEqualsZero.java
##########
@@ -82,6 +93,23 @@ public static ErrorDescription sizeNotEqualsZero(HintContext 
ctx) {
         return sizeEqualsZeroHint(ctx, true);
     }
 
+    @TriggerPatterns({
+        @TriggerPattern(value="$subj.size() > 0",
+            constraints = @ConstraintVariableType(type = 
"java.util.Collection", variable = "$subj")),
+        @TriggerPattern(value="$subj.size() > 0",
+            constraints = @ConstraintVariableType(type = "java.util.Map", 
variable = "$subj")),
+        @TriggerPattern(value="0 < $subj.size()",
+            constraints = @ConstraintVariableType(type = 
"java.util.Collection", variable = "$subj")),
+        @TriggerPattern(value="0 < $subj.size()",
+            constraints = @ConstraintVariableType(type = "java.util.Map", 
variable = "$subj")),
+    })
+    public static ErrorDescription sizeGreaterZero(HintContext ctx) {
+        if (!ctx.getPreferences().getBoolean(CHECK_GREATER_ZERO, 
CHECK_NOT_EQUALS_DEFAULT)) {
+            return null;
+        }
+        return sizeEqualsZeroHint(ctx, true);

Review comment:
       is `not == true` correct in this invocation ?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to