You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2021/04/12 06:04:26 UTC

[groovy] 20/26: GROOVY-9649: Sonar refactoring

This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch groovy9649
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit a44f35a7155101fde0dd6e1ef9e7d0ba37b638a1
Author: Esko Toivonen <es...@tuni.fi>
AuthorDate: Fri Apr 9 12:16:18 2021 +0300

    GROOVY-9649: Sonar refactoring
    
    Avoid NPE by not using a Boolean as an expression
---
 .../org/codehaus/groovy/runtime/DefaultGroovyMethodsSupport.java  | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethodsSupport.java b/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethodsSupport.java
index 14f2b9d..0becd0a 100644
--- a/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethodsSupport.java
+++ b/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethodsSupport.java
@@ -108,17 +108,17 @@ public class DefaultGroovyMethodsSupport {
 
         // Undo inclusiveness effects done by subListBorders()
         if (!info.reverse) {
-            if (!range.getInclusiveLeft()) {
+            if (Boolean.FALSE.equals(range.getInclusiveLeft())) {
                 from--;
             }
-            if (!range.getInclusiveRight()) {
+            if (Boolean.FALSE.equals(range.getInclusiveRight())) {
                 to++;
             }
         } else {
-            if (!range.getInclusiveLeft()) {
+            if (Boolean.FALSE.equals(range.getInclusiveLeft())) {
                 to++;
             }
-            if (!range.getInclusiveRight()) {
+            if (Boolean.FALSE.equals(range.getInclusiveRight())) {
                 from--;
             }
         }