You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@zookeeper.apache.org by GitBox <gi...@apache.org> on 2020/01/09 23:07:33 UTC

[GitHub] [zookeeper] belugabehr opened a new pull request #1213: ZOOKEEPER-3685: Use JDK Arrays Equals for Jute

belugabehr opened a new pull request #1213: ZOOKEEPER-3685: Use JDK Arrays Equals for Jute
URL: https://github.com/apache/zookeeper/pull/1213
 
 
   

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


With regards,
Apache Git Services

[GitHub] [zookeeper] eolivelli commented on a change in pull request #1213: ZOOKEEPER-3685: Use JDK Arrays Equals for Jute

Posted by GitBox <gi...@apache.org>.
eolivelli commented on a change in pull request #1213: ZOOKEEPER-3685: Use JDK Arrays Equals for Jute
URL: https://github.com/apache/zookeeper/pull/1213#discussion_r365007971
 
 

 ##########
 File path: zookeeper-jute/src/main/java/org/apache/jute/Utils.java
 ##########
 @@ -30,32 +30,6 @@ private Utils() {
         super();
     }
 
-    /**
-     * equals function that actually compares two buffers.
-     *
-     * @param onearray First buffer
-     * @param twoarray Second buffer
-     * @return true if one and two contain exactly the same content, else false.
-     */
-    public static boolean bufEquals(byte[] onearray, byte[] twoarray) {
-        if (onearray == twoarray) {
-            return true;
-        }
-
-        boolean ret = (onearray.length == twoarray.length);
-
-        if (!ret) {
-            return ret;
-        }
-
-        for (int idx = 0; idx < onearray.length; idx++) {
-            if (onearray[idx] != twoarray[idx]) {
-                return false;
-            }
-        }
-        return true;
-    }
-
     public static int compareBytes(byte[] b1, int off1, int len1, byte[] b2, int off2, int len2) {
 
 Review comment:
   Do you want to try to use Arrays.compare introduced in JDK9, in is another hotspot intrinsic ? 
   We should go for a multi release jar
   I have done it in this project
   https://github.com/diennea/herddb/blob/master/herddb-utils/src/main/java10/herddb/utils/CompareBytesUtils.java
   
   It is just a suggestion, I see you like this kind of stuff, the same for me :-)  

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


With regards,
Apache Git Services

[GitHub] [zookeeper] belugabehr commented on a change in pull request #1213: ZOOKEEPER-3685: Use JDK Arrays Equals for Jute

Posted by GitBox <gi...@apache.org>.
belugabehr commented on a change in pull request #1213: ZOOKEEPER-3685: Use JDK Arrays Equals for Jute
URL: https://github.com/apache/zookeeper/pull/1213#discussion_r365258716
 
 

 ##########
 File path: zookeeper-jute/src/main/java/org/apache/jute/Utils.java
 ##########
 @@ -30,32 +30,6 @@ private Utils() {
         super();
     }
 
-    /**
-     * equals function that actually compares two buffers.
-     *
-     * @param onearray First buffer
-     * @param twoarray Second buffer
-     * @return true if one and two contain exactly the same content, else false.
-     */
-    public static boolean bufEquals(byte[] onearray, byte[] twoarray) {
-        if (onearray == twoarray) {
-            return true;
-        }
-
-        boolean ret = (onearray.length == twoarray.length);
-
-        if (!ret) {
-            return ret;
-        }
-
-        for (int idx = 0; idx < onearray.length; idx++) {
-            if (onearray[idx] != twoarray[idx]) {
-                return false;
-            }
-        }
-        return true;
-    }
-
     public static int compareBytes(byte[] b1, int off1, int len1, byte[] b2, int off2, int len2) {
 
 Review comment:
   @eolivelli I don't think the group of folks here is quite large enough to be supporting mult-version releases.  I think it's best just to focus on getting everything up to JDK 1.8 spec first and then continue to increment JDK versions over time.

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


With regards,
Apache Git Services

[GitHub] [zookeeper] asfgit closed pull request #1213: ZOOKEEPER-3685: Use JDK Arrays Equals for Jute

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #1213: ZOOKEEPER-3685: Use JDK Arrays Equals for Jute
URL: https://github.com/apache/zookeeper/pull/1213
 
 
   

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


With regards,
Apache Git Services

[GitHub] [zookeeper] nkalmar commented on issue #1213: ZOOKEEPER-3685: Use JDK Arrays Equals for Jute

Posted by GitBox <gi...@apache.org>.
nkalmar commented on issue #1213: ZOOKEEPER-3685: Use JDK Arrays Equals for Jute
URL: https://github.com/apache/zookeeper/pull/1213#issuecomment-585240776
 
 
   merged to master. Thanks @belugabehr 

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


With regards,
Apache Git Services