From a1fa9fdce451f6a4dc0cac90c8d2630bfde816aa Mon Sep 17 00:00:00 2001 From: "Yuan.Wang" Date: Wed, 28 Sep 2022 14:55:50 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-81024=20websocket=E8=BF=9E=E6=8E=A5?= =?UTF-8?q?=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/io/netty/util/Recycler.java | 2 +- .../util/internal/PlatformDependent.java | 96 +++++++++---------- 2 files changed, 49 insertions(+), 49 deletions(-) diff --git a/fine-netty/src/main/java/io/netty/util/Recycler.java b/fine-netty/src/main/java/io/netty/util/Recycler.java index f518aaa09..b83153d4a 100644 --- a/fine-netty/src/main/java/io/netty/util/Recycler.java +++ b/fine-netty/src/main/java/io/netty/util/Recycler.java @@ -21,7 +21,7 @@ import io.netty.util.internal.PlatformDependent; import io.netty.util.internal.SystemPropertyUtil; import io.netty.util.internal.logging.InternalLogger; import io.netty.util.internal.logging.InternalLoggerFactory; -import org.jctools.queues.MessagePassingQueue; +import io.netty.util.internal.shaded.org.jctools.queues.MessagePassingQueue; import java.util.ArrayDeque; import java.util.Queue; diff --git a/fine-netty/src/main/java/io/netty/util/internal/PlatformDependent.java b/fine-netty/src/main/java/io/netty/util/internal/PlatformDependent.java index 00310e585..27750850e 100644 --- a/fine-netty/src/main/java/io/netty/util/internal/PlatformDependent.java +++ b/fine-netty/src/main/java/io/netty/util/internal/PlatformDependent.java @@ -18,16 +18,16 @@ package io.netty.util.internal; import io.netty.util.CharsetUtil; import io.netty.util.internal.logging.InternalLogger; import io.netty.util.internal.logging.InternalLoggerFactory; -import org.jctools.queues.MpscArrayQueue; -import org.jctools.queues.MpscChunkedArrayQueue; -import org.jctools.queues.MpscUnboundedArrayQueue; -import org.jctools.queues.SpscLinkedQueue; -import org.jctools.queues.atomic.MpscAtomicArrayQueue; -import org.jctools.queues.atomic.MpscChunkedAtomicArrayQueue; -import org.jctools.queues.atomic.MpscUnboundedAtomicArrayQueue; -import org.jctools.queues.atomic.SpscLinkedAtomicQueue; -import org.jctools.util.Pow2; -import org.jctools.util.UnsafeAccess; +import io.netty.util.internal.shaded.org.jctools.queues.MpscArrayQueue; +import io.netty.util.internal.shaded.org.jctools.queues.MpscChunkedArrayQueue; +import io.netty.util.internal.shaded.org.jctools.queues.MpscUnboundedArrayQueue; +import io.netty.util.internal.shaded.org.jctools.queues.SpscLinkedQueue; +import io.netty.util.internal.shaded.org.jctools.queues.atomic.MpscAtomicArrayQueue; +import io.netty.util.internal.shaded.org.jctools.queues.atomic.MpscChunkedAtomicArrayQueue; +import io.netty.util.internal.shaded.org.jctools.queues.atomic.MpscUnboundedAtomicArrayQueue; +import io.netty.util.internal.shaded.org.jctools.queues.atomic.SpscLinkedAtomicQueue; +import io.netty.util.internal.shaded.org.jctools.util.Pow2; +import io.netty.util.internal.shaded.org.jctools.util.UnsafeAccess; import java.io.BufferedReader; import java.io.File; @@ -200,7 +200,7 @@ public final class PlatformDependent { // We should always prefer direct buffers by default if we can use a Cleaner to release direct buffers. DIRECT_BUFFER_PREFERRED = CLEANER != NOOP - && !SystemPropertyUtil.getBoolean("io.netty.noPreferDirect", false); + && !SystemPropertyUtil.getBoolean("io.netty.noPreferDirect", false); if (logger.isDebugEnabled()) { logger.debug("-Dio.netty.noPreferDirect: {}", !DIRECT_BUFFER_PREFERRED); } @@ -212,8 +212,8 @@ public final class PlatformDependent { if (CLEANER == NOOP && !PlatformDependent0.isExplicitNoUnsafe()) { logger.info( "Your platform does not provide complete low-level API for accessing direct buffers reliably. " + - "Unless explicitly requested, heap buffer will always be preferred to avoid potential system " + - "instability."); + "Unless explicitly requested, heap buffer will always be preferred to avoid potential system " + + "instability."); } final Set allowedClassifiers = Collections.unmodifiableSet( @@ -626,14 +626,14 @@ public final class PlatformDependent { if (BIG_ENDIAN_NATIVE_ORDER) { // mimic a unsafe.getInt call on a big endian machine return (value.charAt(offset + 3) & 0x1f) | - (value.charAt(offset + 2) & 0x1f) << 8 | - (value.charAt(offset + 1) & 0x1f) << 16 | - (value.charAt(offset) & 0x1f) << 24; + (value.charAt(offset + 2) & 0x1f) << 8 | + (value.charAt(offset + 1) & 0x1f) << 16 | + (value.charAt(offset) & 0x1f) << 24; } return (value.charAt(offset + 3) & 0x1f) << 24 | - (value.charAt(offset + 2) & 0x1f) << 16 | - (value.charAt(offset + 1) & 0x1f) << 8 | - (value.charAt(offset) & 0x1f); + (value.charAt(offset + 2) & 0x1f) << 16 | + (value.charAt(offset + 1) & 0x1f) << 8 | + (value.charAt(offset) & 0x1f); } /** @@ -710,7 +710,7 @@ public final class PlatformDependent { public static void copyMemory(byte[] src, int srcIndex, byte[] dst, int dstIndex, long length) { PlatformDependent0.copyMemory(src, BYTE_ARRAY_BASE_OFFSET + srcIndex, - dst, BYTE_ARRAY_BASE_OFFSET + dstIndex, length); + dst, BYTE_ARRAY_BASE_OFFSET + dstIndex, length); } public static void copyMemory(long srcAddr, byte[] dst, int dstIndex, long length) { @@ -834,8 +834,8 @@ public final class PlatformDependent { */ public static boolean equals(byte[] bytes1, int startPos1, byte[] bytes2, int startPos2, int length) { return !hasUnsafe() || !unalignedAccess() ? - equalsSafe(bytes1, startPos1, bytes2, startPos2, length) : - PlatformDependent0.equals(bytes1, startPos1, bytes2, startPos2, length); + equalsSafe(bytes1, startPos1, bytes2, startPos2, length) : + PlatformDependent0.equals(bytes1, startPos1, bytes2, startPos2, length); } /** @@ -874,8 +874,8 @@ public final class PlatformDependent { */ public static int equalsConstantTime(byte[] bytes1, int startPos1, byte[] bytes2, int startPos2, int length) { return !hasUnsafe() || !unalignedAccess() ? - ConstantTimeUtils.equalsConstantTime(bytes1, startPos1, bytes2, startPos2, length) : - PlatformDependent0.equalsConstantTime(bytes1, startPos1, bytes2, startPos2, length); + ConstantTimeUtils.equalsConstantTime(bytes1, startPos1, bytes2, startPos2, length) : + PlatformDependent0.equalsConstantTime(bytes1, startPos1, bytes2, startPos2, length); } /** @@ -965,10 +965,10 @@ public final class PlatformDependent { } if (unsafe == null) { - logger.debug("org.jctools-core.MpscChunkedArrayQueue: unavailable"); + logger.debug("io.netty.util.internal.shaded.org.jctools.core.MpscChunkedArrayQueue: unavailable"); USE_MPSC_CHUNKED_ARRAY_QUEUE = false; } else { - logger.debug("org.jctools-core.MpscChunkedArrayQueue: available"); + logger.debug("io.netty.util.internal.shaded.org.jctools.core.MpscChunkedArrayQueue: available"); USE_MPSC_CHUNKED_ARRAY_QUEUE = true; } } @@ -988,7 +988,7 @@ public final class PlatformDependent { static Queue newMpscQueue() { return USE_MPSC_CHUNKED_ARRAY_QUEUE ? new MpscUnboundedArrayQueue(MPSC_CHUNK_SIZE) - : new MpscUnboundedAtomicArrayQueue(MPSC_CHUNK_SIZE); + : new MpscUnboundedAtomicArrayQueue(MPSC_CHUNK_SIZE); } } @@ -1403,27 +1403,27 @@ public final class PlatformDependent { hash = PlatformDependent0.hashCodeAsciiCompute(getLongSafe(bytes, i), hash); } switch(remainingBytes) { - case 7: - return ((hash * HASH_CODE_C1 + hashCodeAsciiSanitize(bytes[startPos])) - * HASH_CODE_C2 + hashCodeAsciiSanitize(getShortSafe(bytes, startPos + 1))) - * HASH_CODE_C1 + hashCodeAsciiSanitize(getIntSafe(bytes, startPos + 3)); - case 6: - return (hash * HASH_CODE_C1 + hashCodeAsciiSanitize(getShortSafe(bytes, startPos))) - * HASH_CODE_C2 + hashCodeAsciiSanitize(getIntSafe(bytes, startPos + 2)); - case 5: - return (hash * HASH_CODE_C1 + hashCodeAsciiSanitize(bytes[startPos])) - * HASH_CODE_C2 + hashCodeAsciiSanitize(getIntSafe(bytes, startPos + 1)); - case 4: - return hash * HASH_CODE_C1 + hashCodeAsciiSanitize(getIntSafe(bytes, startPos)); - case 3: - return (hash * HASH_CODE_C1 + hashCodeAsciiSanitize(bytes[startPos])) - * HASH_CODE_C2 + hashCodeAsciiSanitize(getShortSafe(bytes, startPos + 1)); - case 2: - return hash * HASH_CODE_C1 + hashCodeAsciiSanitize(getShortSafe(bytes, startPos)); - case 1: - return hash * HASH_CODE_C1 + hashCodeAsciiSanitize(bytes[startPos]); - default: - return hash; + case 7: + return ((hash * HASH_CODE_C1 + hashCodeAsciiSanitize(bytes[startPos])) + * HASH_CODE_C2 + hashCodeAsciiSanitize(getShortSafe(bytes, startPos + 1))) + * HASH_CODE_C1 + hashCodeAsciiSanitize(getIntSafe(bytes, startPos + 3)); + case 6: + return (hash * HASH_CODE_C1 + hashCodeAsciiSanitize(getShortSafe(bytes, startPos))) + * HASH_CODE_C2 + hashCodeAsciiSanitize(getIntSafe(bytes, startPos + 2)); + case 5: + return (hash * HASH_CODE_C1 + hashCodeAsciiSanitize(bytes[startPos])) + * HASH_CODE_C2 + hashCodeAsciiSanitize(getIntSafe(bytes, startPos + 1)); + case 4: + return hash * HASH_CODE_C1 + hashCodeAsciiSanitize(getIntSafe(bytes, startPos)); + case 3: + return (hash * HASH_CODE_C1 + hashCodeAsciiSanitize(bytes[startPos])) + * HASH_CODE_C2 + hashCodeAsciiSanitize(getShortSafe(bytes, startPos + 1)); + case 2: + return hash * HASH_CODE_C1 + hashCodeAsciiSanitize(getShortSafe(bytes, startPos)); + case 1: + return hash * HASH_CODE_C1 + hashCodeAsciiSanitize(bytes[startPos]); + default: + return hash; } }