You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2021/06/21 19:07:26 UTC

[GitHub] [commons-ognl] arturobernalg opened a new pull request #46: Minor Changes:

arturobernalg opened a new pull request #46:
URL: https://github.com/apache/commons-ognl/pull/46


   * Simplify conditions.
   * Remove unnecessary 'null' check.


-- 
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:
users@infra.apache.org



[GitHub] [commons-ognl] arturobernalg commented on a change in pull request #46: Minor Changes:

Posted by GitBox <gi...@apache.org>.
arturobernalg commented on a change in pull request #46:
URL: https://github.com/apache/commons-ognl/pull/46#discussion_r656510207



##########
File path: src/main/java/org/apache/commons/ognl/ASTAdd.java
##########
@@ -129,13 +129,6 @@ boolean isWider( NodeType type, NodeType lastType )
         {
             return false;
         }
-
-        if ( Float.class.isAssignableFrom( type.getGetterClass() )
-            && Integer.class.isAssignableFrom( lastType.getGetterClass() ) )
-        {
-            return true;
-        }

Review comment:
       > Why did you remove this?
   
   Hi. @lukaszlenart 
   If the code get there, always will return true
   
   
    ```
    if ( Float.class.isAssignableFrom( type.getGetterClass() )
               && Integer.class.isAssignableFrom( lastType.getGetterClass() ) )
           {
               return true;
           }
   
           return true;
   ```




-- 
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:
users@infra.apache.org



[GitHub] [commons-ognl] lukaszlenart commented on a change in pull request #46: Minor Changes:

Posted by GitBox <gi...@apache.org>.
lukaszlenart commented on a change in pull request #46:
URL: https://github.com/apache/commons-ognl/pull/46#discussion_r655877580



##########
File path: src/main/java/org/apache/commons/ognl/ASTVarRef.java
##########
@@ -124,7 +124,7 @@ public String toGetSourceString( OgnlContext context, Object target )
             post = ")";
         }
 
-        if ( parent != null && ASTAssign.class.isInstance( parent ) )
+        if (ASTAssign.class.isInstance(parent))

Review comment:
       Why not to use `isinstanceof`?

##########
File path: src/main/java/org/apache/commons/ognl/ASTAdd.java
##########
@@ -129,13 +129,6 @@ boolean isWider( NodeType type, NodeType lastType )
         {
             return false;
         }
-
-        if ( Float.class.isAssignableFrom( type.getGetterClass() )
-            && Integer.class.isAssignableFrom( lastType.getGetterClass() ) )
-        {
-            return true;
-        }

Review comment:
       Why did you remove this?




-- 
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:
users@infra.apache.org



[GitHub] [commons-ognl] lukaszlenart commented on pull request #46: Minor Changes:

Posted by GitBox <gi...@apache.org>.
lukaszlenart commented on pull request #46:
URL: https://github.com/apache/commons-ognl/pull/46#issuecomment-866285694


   I think you need to rebase this PR over master branch


-- 
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:
users@infra.apache.org



[GitHub] [commons-ognl] arturobernalg closed pull request #46: Minor Changes:

Posted by GitBox <gi...@apache.org>.
arturobernalg closed pull request #46:
URL: https://github.com/apache/commons-ognl/pull/46


   


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

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [commons-ognl] lukaszlenart commented on a change in pull request #46: Minor Changes:

Posted by GitBox <gi...@apache.org>.
lukaszlenart commented on a change in pull request #46:
URL: https://github.com/apache/commons-ognl/pull/46#discussion_r656532452



##########
File path: src/main/java/org/apache/commons/ognl/ASTAdd.java
##########
@@ -129,13 +129,6 @@ boolean isWider( NodeType type, NodeType lastType )
         {
             return false;
         }
-
-        if ( Float.class.isAssignableFrom( type.getGetterClass() )
-            && Integer.class.isAssignableFrom( lastType.getGetterClass() ) )
-        {
-            return true;
-        }

Review comment:
       Right, but I think it can also be misleading why there is no `Float` and `Integer` check as above.




-- 
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:
users@infra.apache.org



[GitHub] [commons-ognl] lukaszlenart commented on a change in pull request #46: Minor Changes:

Posted by GitBox <gi...@apache.org>.
lukaszlenart commented on a change in pull request #46:
URL: https://github.com/apache/commons-ognl/pull/46#discussion_r655877580



##########
File path: src/main/java/org/apache/commons/ognl/ASTVarRef.java
##########
@@ -124,7 +124,7 @@ public String toGetSourceString( OgnlContext context, Object target )
             post = ")";
         }
 
-        if ( parent != null && ASTAssign.class.isInstance( parent ) )
+        if (ASTAssign.class.isInstance(parent))

Review comment:
       Why not to use `isinstanceof`?

##########
File path: src/main/java/org/apache/commons/ognl/ASTAdd.java
##########
@@ -129,13 +129,6 @@ boolean isWider( NodeType type, NodeType lastType )
         {
             return false;
         }
-
-        if ( Float.class.isAssignableFrom( type.getGetterClass() )
-            && Integer.class.isAssignableFrom( lastType.getGetterClass() ) )
-        {
-            return true;
-        }

Review comment:
       Why did you remove this?




-- 
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:
users@infra.apache.org