You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by li...@apache.org on 2023/02/26 07:59:23 UTC

[tomcat] branch 9.0.x updated (90a3050e93 -> 84bf5da3a6)

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

lihan pushed a change to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


    from 90a3050e93 Refactor to reduce native calls
     new 75d1d8736d Replace with JDK 1.8 Integer::compareUnsigned(int, int).
     new 84bf5da3a6 Update 'ide-intellij' target to overwrite old config.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 build.xml                                           |  2 +-
 .../apache/tomcat/util/codec/binary/BaseNCodec.java | 21 ++-------------------
 2 files changed, 3 insertions(+), 20 deletions(-)


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[tomcat] 02/02: Update 'ide-intellij' target to overwrite old config.

Posted by li...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

lihan pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 84bf5da3a6c8aac36b88b1e512e72df1278160d7
Author: lihan <li...@apache.org>
AuthorDate: Sun Feb 26 15:53:22 2023 +0800

    Update 'ide-intellij' target to overwrite old config.
---
 build.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/build.xml b/build.xml
index b420c2a59d..e07317e76d 100644
--- a/build.xml
+++ b/build.xml
@@ -3758,7 +3758,7 @@ Read the Building page on the Apache Tomcat documentation site for details on ho
           depends="download-compile, download-test-compile"
           description="Creates project directory .idea for IntelliJ IDEA">
 
-    <copy todir="${tomcat.home}/.idea">
+    <copy todir="${tomcat.home}/.idea" overwrite="true">
       <fileset dir="${tomcat.home}/res/ide-support/idea"/>
       <filterset refid="classpath.filters"/>
       <filterset refid="version.filters"/>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[tomcat] 01/02: Replace with JDK 1.8 Integer::compareUnsigned(int, int).

Posted by li...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

lihan pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 75d1d8736d1bb8d1b43eeb228b1df3ca352ede57
Author: lihan <li...@apache.org>
AuthorDate: Sun Feb 26 15:11:17 2023 +0800

    Replace with JDK 1.8 Integer::compareUnsigned(int, int).
---
 .../apache/tomcat/util/codec/binary/BaseNCodec.java | 21 ++-------------------
 1 file changed, 2 insertions(+), 19 deletions(-)

diff --git a/java/org/apache/tomcat/util/codec/binary/BaseNCodec.java b/java/org/apache/tomcat/util/codec/binary/BaseNCodec.java
index a234da2f0c..32eaa33e5b 100644
--- a/java/org/apache/tomcat/util/codec/binary/BaseNCodec.java
+++ b/java/org/apache/tomcat/util/codec/binary/BaseNCodec.java
@@ -160,23 +160,6 @@ public abstract class BaseNCodec {
      */
     static final byte[] CHUNK_SEPARATOR = {'\r', '\n'};
 
-    /**
-     * Compares two {@code int} values numerically treating the values
-     * as unsigned. Taken from JDK 1.8.
-     *
-     * <p>TODO: Replace with JDK 1.8 Integer::compareUnsigned(int, int).</p>
-     *
-     * @param  x the first {@code int} to compare
-     * @param  y the second {@code int} to compare
-     * @return the value {@code 0} if {@code x == y}; a value less
-     *         than {@code 0} if {@code x < y} as unsigned values; and
-     *         a value greater than {@code 0} if {@code x > y} as
-     *         unsigned values
-     */
-    private static int compareUnsigned(final int x, final int y) {
-        return Integer.compare(x + Integer.MIN_VALUE, y + Integer.MIN_VALUE);
-    }
-
     /**
      * Create a positive capacity at least as large the minimum required capacity.
      * If the minimum capacity is negative then this throws an OutOfMemoryError as no array
@@ -243,10 +226,10 @@ public abstract class BaseNCodec {
         // Overflow-conscious code treats the min and new capacity as unsigned.
         final int oldCapacity = context.buffer.length;
         int newCapacity = oldCapacity * DEFAULT_BUFFER_RESIZE_FACTOR;
-        if (compareUnsigned(newCapacity, minCapacity) < 0) {
+        if (Integer.compareUnsigned(newCapacity, minCapacity) < 0) {
             newCapacity = minCapacity;
         }
-        if (compareUnsigned(newCapacity, MAX_BUFFER_SIZE) > 0) {
+        if (Integer.compareUnsigned(newCapacity, MAX_BUFFER_SIZE) > 0) {
             newCapacity = createPositiveCapacity(minCapacity);
         }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org