diff --git a/0001-Avoid-bundling-asm.patch b/0001-Avoid-bundling-asm.patch index 272fdaf..bc8bcd1 100644 --- a/0001-Avoid-bundling-asm.patch +++ b/0001-Avoid-bundling-asm.patch @@ -1,14 +1,14 @@ -From 395fcc56d403d0625fe4930af4b2b772b0958fe1 Mon Sep 17 00:00:00 2001 +From beaed3d4ce80ae695f7f2a3e02e11c39fbb4e1f8 Mon Sep 17 00:00:00 2001 From: Marian Koncek -Date: Tue, 9 Nov 2021 11:55:22 +0100 +Date: Thu, 23 Feb 2023 13:59:25 +0100 Subject: [PATCH] Avoid bundling asm --- - byte-buddy/pom.xml | 70 ++++++++++------------------------------------ - 1 file changed, 15 insertions(+), 55 deletions(-) + byte-buddy/pom.xml | 56 +++++++++------------------------------------- + 1 file changed, 11 insertions(+), 45 deletions(-) diff --git a/byte-buddy/pom.xml b/byte-buddy/pom.xml -index 403f684..0d1d98c 100644 +index 625e0d6..97ac874 100644 --- a/byte-buddy/pom.xml +++ b/byte-buddy/pom.xml @@ -26,8 +26,6 @@ @@ -20,89 +20,19 @@ index 403f684..0d1d98c 100644 net.bytebuddy, net.bytebuddy.agent.builder, -@@ -62,9 +60,6 @@ +@@ -62,10 +60,7 @@ net.bytebuddy.utility, + net.bytebuddy.utility.nullability, net.bytebuddy.utility.privilege, - net.bytebuddy.utility.visitor, +- net.bytebuddy.utility.visitor, - ${shade.target}, - ${shade.target}.signature, - ${shade.target}.commons ++ net.bytebuddy.utility.visitor net.bytebuddy.utility.dispatcher -@@ -120,44 +115,6 @@ - true - ${bytebuddy.extras} - true -- -- -- ${shade.source} -- ${shade.target} -- -- -- -- -- net.bytebuddy:byte-buddy-dep:* -- -- META-INF/MANIFEST.MF -- -- -- -- org.ow2.asm:* -- -- META-INF/MANIFEST.MF -- **/module-info.class -- **/LICENSE -- **/NOTICE -- -- -- -- org.ow2.asm:asm-commons -- -- org/objectweb/asm/commons/AnnotationRemapper.** -- org/objectweb/asm/commons/ClassRemapper.** -- org/objectweb/asm/commons/FieldRemapper.** -- org/objectweb/asm/commons/MethodRemapper.** -- org/objectweb/asm/commons/ModuleHashesAttribute.** -- org/objectweb/asm/commons/ModuleRemapper.** -- org/objectweb/asm/commons/RecordComponentRemapper.** -- org/objectweb/asm/commons/Remapper.** -- org/objectweb/asm/commons/SignatureRemapper.** -- org/objectweb/asm/commons/SimpleRemapper.** -- -- -- - - - net.bytebuddy.build.Plugin$Engine$Default -@@ -166,21 +123,14 @@ - META-INF/LICENSE - - -+ -+ -+ org.ow2.asm:* -+ -+ - - - -- -- -- org.ow2.asm -- asm -- ${version.asm} -- -- -- org.ow2.asm -- asm-commons -- ${version.asm} -- -- - - - -@@ -243,6 +193,16 @@ +@@ -166,6 +161,16 @@ asm ${version.asm} @@ -119,6 +49,52 @@ index 403f684..0d1d98c 100644 +@@ -253,45 +258,6 @@ + true + ${bytebuddy.extras} + true +- +- +- ${shade.source} +- ${shade.target} +- +- +- +- +- net.bytebuddy:byte-buddy-dep:* +- +- META-INF/MANIFEST.MF +- META-INF/maven/** +- +- +- +- org.ow2.asm:* +- +- META-INF/MANIFEST.MF +- **/module-info.class +- **/LICENSE +- **/NOTICE +- +- +- +- org.ow2.asm:asm-commons +- +- org/objectweb/asm/commons/AnnotationRemapper.** +- org/objectweb/asm/commons/ClassRemapper.** +- org/objectweb/asm/commons/FieldRemapper.** +- org/objectweb/asm/commons/MethodRemapper.** +- org/objectweb/asm/commons/ModuleHashesAttribute.** +- org/objectweb/asm/commons/ModuleRemapper.** +- org/objectweb/asm/commons/RecordComponentRemapper.** +- org/objectweb/asm/commons/Remapper.** +- org/objectweb/asm/commons/SignatureRemapper.** +- org/objectweb/asm/commons/SimpleRemapper.** +- +- +- + + + net.bytebuddy.build.Plugin$Engine$Default -- -2.31.1 +2.39.1 diff --git a/0002-Remove-dependencies.patch b/0002-Remove-dependencies.patch index 024780c..8f41c55 100644 --- a/0002-Remove-dependencies.patch +++ b/0002-Remove-dependencies.patch @@ -1,18 +1,20 @@ -From c54cc280a38d05ffe93a1af6922afcefe4d0cf71 Mon Sep 17 00:00:00 2001 -From: Marian Koncek -Date: Mon, 1 Nov 2021 12:51:02 +0100 +From 275eddca5709ba871ad734a76ae1238b91fc79b9 Mon Sep 17 00:00:00 2001 +From: cherry530 <707078654@qq.com> +Date: Tue, 1 Aug 2023 09:53:43 +0800 Subject: [PATCH] Remove dependencies +Signed-off-by: cherry530 <707078654@qq.com> --- - .../net/bytebuddy/agent/VirtualMachine.java | 1978 +---------------- - .../dynamic/loading/ClassInjector.java | 104 +- - 2 files changed, 2 insertions(+), 2080 deletions(-) + .../net/bytebuddy/agent/VirtualMachine.java | 2006 +---------------- + .../description/type/TypeDescription.java | 3 - + .../dynamic/loading/ClassInjector.java | 98 +- + 3 files changed, 2 insertions(+), 2105 deletions(-) diff --git a/byte-buddy-agent/src/main/java/net/bytebuddy/agent/VirtualMachine.java b/byte-buddy-agent/src/main/java/net/bytebuddy/agent/VirtualMachine.java -index 32fe7d1fad..795d648512 100644 +index 7a748ad..d15d47d 100644 --- a/byte-buddy-agent/src/main/java/net/bytebuddy/agent/VirtualMachine.java +++ b/byte-buddy-agent/src/main/java/net/bytebuddy/agent/VirtualMachine.java -@@ -15,13 +15,6 @@ +@@ -15,11 +15,6 @@ */ package net.bytebuddy.agent; @@ -21,12 +23,10 @@ index 32fe7d1fad..795d648512 100644 -import com.sun.jna.ptr.IntByReference; -import com.sun.jna.win32.StdCallLibrary; -import com.sun.jna.win32.W32APIOptions; --import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; -- - import java.io.*; - import java.net.ServerSocket; - import java.net.Socket; -@@ -149,15 +142,7 @@ public interface VirtualMachine { + import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; + import net.bytebuddy.agent.utility.nullability.MaybeNull; + import net.bytebuddy.agent.utility.nullability.UnknownNull; +@@ -151,15 +146,7 @@ public interface VirtualMachine { * {@inheritDoc} */ public Class run() { @@ -43,7 +43,7 @@ index 32fe7d1fad..795d648512 100644 } } -@@ -227,23 +212,6 @@ public interface VirtualMachine { +@@ -229,23 +216,6 @@ public interface VirtualMachine { this.connection = connection; } @@ -67,15 +67,7 @@ index 32fe7d1fad..795d648512 100644 /** * Attaches to the supplied process id using the supplied connection factory. * -@@ -515,7 +483,6 @@ public interface VirtualMachine { - /** - * {@inheritDoc} - */ -- @SuppressFBWarnings(value = "DMI_HARDCODED_ABSOLUTE_FILENAME", justification = "File name convention is specified.") - public Connection connect(String processId) throws IOException { - File socket = new File(temporaryDirectory, SOCKET_FILE_PREFIX + processId); - if (!socket.exists()) { -@@ -679,1949 +646,6 @@ public interface VirtualMachine { +@@ -681,1980 +651,6 @@ public interface VirtualMachine { */ protected abstract int read(T connection, byte[] buffer) throws IOException; } @@ -331,7 +323,7 @@ index 32fe7d1fad..795d648512 100644 - /** - * Reads a configuration dependant variable into a memory segment. - * -- * @param name The name of the variable. +- * @param name The name of the variable. - * @param buffer The buffer to read the variable into. - * @param length The length of the buffer. - * @return The amount of bytes written to the buffer. @@ -529,14 +521,15 @@ index 32fe7d1fad..795d648512 100644 - * @param threadId A pointer to the thread id or {@code null} if no thread reference is set. - * @return A handle to the created remote thread or {@code null} if the creation failed. - */ +- @MaybeNull - @SuppressWarnings("checkstyle:methodname") - WinNT.HANDLE CreateRemoteThread(WinNT.HANDLE process, -- WinBase.SECURITY_ATTRIBUTES securityAttributes, +- @MaybeNull WinBase.SECURITY_ATTRIBUTES securityAttributes, - int stackSize, - Pointer code, - Pointer argument, -- WinDef.DWORD creationFlags, -- Pointer threadId); +- @MaybeNull WinDef.DWORD creationFlags, +- @MaybeNull Pointer threadId); - - /** - * Receives the exit code of a given thread. @@ -560,6 +553,7 @@ index 32fe7d1fad..795d648512 100644 - * @param process A handle to the target process. - * @return A pointer to the allocated code or {@code null} if the code could not be allocated. - */ +- @MaybeNull - @SuppressWarnings("checkstyle:methodname") - WinDef.LPVOID allocate_remote_code(WinNT.HANDLE process); - @@ -574,13 +568,14 @@ index 32fe7d1fad..795d648512 100644 - * @param argument3 The forth argument or {@code null} if no such argument is provided. - * @return A pointer to the allocated argument or {@code null} if the argument could not be allocated. - */ +- @MaybeNull - @SuppressWarnings("checkstyle:methodname") - WinDef.LPVOID allocate_remote_argument(WinNT.HANDLE process, - String pipe, -- String argument0, -- String argument1, -- String argument2, -- String argument3); +- @MaybeNull String argument0, +- @MaybeNull String argument1, +- @MaybeNull String argument2, +- @MaybeNull String argument3); - } - - /** @@ -838,6 +833,7 @@ index 32fe7d1fad..795d648512 100644 - /** - * A pointer to the operation argument. - */ +- @MaybeNull - public Pointer dataPointer; - - /** @@ -848,6 +844,7 @@ index 32fe7d1fad..795d648512 100644 - /** - * A pointer to the operation descriptor. - */ +- @MaybeNull - public Pointer descriptorPointer; - - /** @@ -858,6 +855,7 @@ index 32fe7d1fad..795d648512 100644 - /** - * A pointer to the operation result. - */ +- @UnknownNull - public Pointer resultPointer; - - /** @@ -966,6 +964,11 @@ index 32fe7d1fad..795d648512 100644 - private static final String IBM_TEMPORARY_FOLDER = "com.ibm.tools.attach.directory"; - - /** +- * A secure random for generating randomized ids. +- */ +- private static final SecureRandom SECURE_RANDOM = new SecureRandom(); +- +- /** - * The socket on which this VM and the target VM communicate. - */ - private final Socket socket; @@ -1002,7 +1005,7 @@ index 32fe7d1fad..795d648512 100644 - * @throws IOException If an IO exception occurs during establishing the connection. - */ - public static VirtualMachine attach(String processId, int timeout, Dispatcher dispatcher) throws IOException { -- File directory = new File(System.getProperty(IBM_TEMPORARY_FOLDER, dispatcher.getTemporaryFolder()), ".com_ibm_tools_attach"); +- File directory = new File(System.getProperty(IBM_TEMPORARY_FOLDER, dispatcher.getTemporaryFolder(processId)), ".com_ibm_tools_attach"); - RandomAccessFile attachLock = new RandomAccessFile(new File(directory, "_attachlock"), "rw"); - try { - FileLock attachLockLock = attachLock.getChannel().lock(); @@ -1077,7 +1080,10 @@ index 32fe7d1fad..795d648512 100644 - try { - serverSocket.setSoTimeout(timeout); - File receiver = new File(directory, target.getProperty("vmId")); -- String key = Long.toHexString(new SecureRandom().nextLong()); +- String key; +- synchronized (SECURE_RANDOM) { +- key = Long.toHexString(SECURE_RANDOM.nextLong()); +- } - File reply = new File(receiver, "replyInfo"); - try { - if (reply.createNewFile()) { @@ -1187,7 +1193,7 @@ index 32fe7d1fad..795d648512 100644 - /** - * {@inheritDoc} - */ -- public void loadAgent(String jarFile, String argument) throws IOException { +- public void loadAgent(String jarFile, @MaybeNull String argument) throws IOException { - write(socket, ("ATTACH_LOADAGENT(instrument," + jarFile + '=' + (argument == null ? "" : argument) + ')').getBytes("UTF-8")); - String answer = new String(read(socket), "UTF-8"); - if (answer.startsWith("ATTACH_ERR")) { @@ -1200,7 +1206,7 @@ index 32fe7d1fad..795d648512 100644 - /** - * {@inheritDoc} - */ -- public void loadAgentPath(String path, String argument) throws IOException { +- public void loadAgentPath(String path, @MaybeNull String argument) throws IOException { - write(socket, ("ATTACH_LOADAGENTPATH(" + path + (argument == null ? "" : (',' + argument)) + ')').getBytes("UTF-8")); - String answer = new String(read(socket), "UTF-8"); - if (answer.startsWith("ATTACH_ERR")) { @@ -1213,7 +1219,7 @@ index 32fe7d1fad..795d648512 100644 - /** - * {@inheritDoc} - */ -- public void loadAgentLibrary(String library, String argument) throws IOException { +- public void loadAgentLibrary(String library, @MaybeNull String argument) throws IOException { - write(socket, ("ATTACH_LOADAGENTLIBRARY(" + library + (argument == null ? "" : (',' + argument)) + ')').getBytes("UTF-8")); - String answer = new String(read(socket), "UTF-8"); - if (answer.startsWith("ATTACH_ERR")) { @@ -1311,9 +1317,10 @@ index 32fe7d1fad..795d648512 100644 - /** - * Returns this machine's temporary folder. - * +- * @param processId The target process's id. - * @return The temporary folder. - */ -- String getTemporaryFolder(); +- String getTemporaryFolder(String processId); - - /** - * Returns the process id of this process. @@ -1416,7 +1423,13 @@ index 32fe7d1fad..795d648512 100644 - /** - * {@inheritDoc} - */ -- public String getTemporaryFolder() { +- public String getTemporaryFolder(String processId) { +- if (Platform.isLinux()) { +- File file = new File("/proc/" + processId + "/root/tmp"); +- if (file.isDirectory() && file.canRead()) { +- return file.getAbsolutePath(); +- } +- } - String temporaryFolder = System.getenv("TMPDIR"); - return temporaryFolder == null ? "/tmp" : temporaryFolder; - } @@ -1450,8 +1463,10 @@ index 32fe7d1fad..795d648512 100644 - try { - // The binding for 'stat' is very platform dependant. To avoid the complexity of binding the correct method, - // stat is called as a separate command. This is less efficient but more portable. -- String statUserSwitch = Platform.isMac() ? "-f" : "-c"; -- Process process = Runtime.getRuntime().exec("stat " + statUserSwitch + " %u " + file.getAbsolutePath()); +- Process process = Runtime.getRuntime().exec(new String[]{"stat", +- Platform.isMac() ? "-f" : "-c", +- "%u", +- file.getAbsolutePath()}); - int attempts = this.attempts; - boolean exited = false; - String line = new BufferedReader(new InputStreamReader(process.getInputStream(), "UTF-8")).readLine(); @@ -1524,7 +1539,7 @@ index 32fe7d1fad..795d648512 100644 - library.semop(semaphore, target, 1); - } catch (LastErrorException exception) { - if (acceptUnavailable && (Native.getLastError() == PosixLibrary.EAGAIN -- || Native.getLastError() == PosixLibrary.EDEADLK)) { +- || Native.getLastError() == PosixLibrary.EDEADLK)) { - break; - } else { - throw exception; @@ -1699,7 +1714,7 @@ index 32fe7d1fad..795d648512 100644 - /** - * {@inheritDoc} - */ -- public String getTemporaryFolder() { +- public String getTemporaryFolder(String processId) { - WinDef.DWORD length = new WinDef.DWORD(WinDef.MAX_PATH); - char[] path = new char[length.intValue()]; - if (Kernel32.INSTANCE.GetTempPath(length, path).intValue() == 0) { @@ -1883,6 +1898,7 @@ index 32fe7d1fad..795d648512 100644 - * @param name The semaphore's name. - * @return The handle or {@code null} if the handle could not be created. - */ +- @MaybeNull - @SuppressWarnings("checkstyle:methodname") - WinNT.HANDLE OpenSemaphoreW(int access, boolean inheritHandle, String name); - @@ -1895,8 +1911,12 @@ index 32fe7d1fad..795d648512 100644 - * @param name The semaphore's name. - * @return The handle or {@code null} if the handle could not be created. - */ +- @MaybeNull - @SuppressWarnings("checkstyle:methodname") -- WinNT.HANDLE CreateSemaphoreW(WinBase.SECURITY_ATTRIBUTES securityAttributes, long count, long maximumCount, String name); +- WinNT.HANDLE CreateSemaphoreW(@MaybeNull WinBase.SECURITY_ATTRIBUTES securityAttributes, +- long count, +- long maximumCount, +- String name); - - /** - * Releases the semaphore. @@ -1907,7 +1927,7 @@ index 32fe7d1fad..795d648512 100644 - * @return {@code true} if the semaphore was successfully released. - */ - @SuppressWarnings("checkstyle:methodname") -- boolean ReleaseSemaphore(WinNT.HANDLE handle, long count, Long previousCount); +- boolean ReleaseSemaphore(WinNT.HANDLE handle, long count, @MaybeNull Long previousCount); - - /** - * Create or opens a mutex. @@ -1917,6 +1937,7 @@ index 32fe7d1fad..795d648512 100644 - * @param name The mutex name. - * @return The handle to the mutex or {@code null} if the mutex could not be created. - */ +- @MaybeNull - @SuppressWarnings("checkstyle:methodname") - WinNT.HANDLE CreateMutex(SecurityAttributes attributes, boolean owner, String name); - @@ -1949,11 +1970,13 @@ index 32fe7d1fad..795d648512 100644 - /** - * The descriptor's length. - */ +- @MaybeNull - public WinDef.DWORD length; - - /** - * A pointer to the descriptor. - */ +- @MaybeNull - public Pointer securityDescriptor; - - /** @@ -2025,82 +2048,43 @@ index 32fe7d1fad..795d648512 100644 } } } +diff --git a/byte-buddy-dep/src/main/java/net/bytebuddy/description/type/TypeDescription.java b/byte-buddy-dep/src/main/java/net/bytebuddy/description/type/TypeDescription.java +index 8b96d13..f96ea70 100644 +--- a/byte-buddy-dep/src/main/java/net/bytebuddy/description/type/TypeDescription.java ++++ b/byte-buddy-dep/src/main/java/net/bytebuddy/description/type/TypeDescription.java +@@ -4409,9 +4409,6 @@ public interface TypeDescription extends TypeDefinition, ByteCodeElement, TypeVa + } + + @Override +- @SuppressFBWarnings( +- value = {"EQ_CHECK_FOR_OPERAND_NOT_COMPATIBLE_WITH_THIS", "NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE"}, +- justification = "Type check is performed by erasure implementation. Assuming component type for array type.") + public boolean equals(@MaybeNull Object other) { + if (this == other) { + return true; diff --git a/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/loading/ClassInjector.java b/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/loading/ClassInjector.java -index 279b6497d2..a63ce63d5c 100644 +index 5880b2d..ad6b01a 100644 --- a/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/loading/ClassInjector.java +++ b/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/loading/ClassInjector.java -@@ -15,8 +15,6 @@ +@@ -15,7 +15,6 @@ */ package net.bytebuddy.dynamic.loading; -import com.sun.jna.*; --import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; + import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import net.bytebuddy.ByteBuddy; import net.bytebuddy.ClassFileVersion; - import net.bytebuddy.asm.MemberRemoval; -@@ -507,7 +505,6 @@ public interface ClassInjector { - /** - * {@inheritDoc} - */ -- @SuppressFBWarnings(value = "REC_CATCH_EXCEPTION", justification = "Exception should not be rethrown but trigger a fallback") - public Initializable run() { - try { - if (JavaModule.isSupported()) { -@@ -583,7 +580,6 @@ public interface ClassInjector { - * @return A direct dispatcher for class injection. - * @throws Exception If the creation is impossible. - */ -- @SuppressFBWarnings(value = "DP_DO_INSIDE_DO_PRIVILEGED", justification = "Privilege is explicit caller responsibility") - protected static Initializable make() throws Exception { - Method getDefinedPackage; - if (JavaModule.isSupported()) { // Avoid accidental lookup of method with same name in Java 8 J9 VM. -@@ -888,7 +884,6 @@ public interface ClassInjector { - * @return An indirect dispatcher for class creation. - * @throws Exception If the dispatcher cannot be created. - */ -- @SuppressFBWarnings(value = "DP_DO_INSIDE_DO_PRIVILEGED", justification = "Privilege is explicit caller responsibility") - protected static Initializable make() throws Exception { - if (Boolean.getBoolean(UsingUnsafe.SAFE_PROPERTY)) { - return new Initializable.Unavailable("Use of Unsafe was disabled by system property"); -@@ -1150,7 +1145,6 @@ public interface ClassInjector { - * @return An appropriate initializable. - * @throws Exception If the injector cannot be created. - */ -- @SuppressFBWarnings(value = "DP_DO_INSIDE_DO_PRIVILEGED", justification = "Privilege is explicit caller responsibility") - protected static Initializable make() throws Exception { - if (Boolean.getBoolean(UsingUnsafe.SAFE_PROPERTY)) { - return new Initializable.Unavailable("Use of Unsafe was disabled by system property"); -@@ -1888,7 +1882,6 @@ public interface ClassInjector { - /** - * {@inheritDoc} - */ -- @SuppressFBWarnings(value = "REC_CATCH_EXCEPTION", justification = "Exception should not be rethrown but trigger a fallback") - public Initializable run() { - if (Boolean.getBoolean(SAFE_PROPERTY)) { - return new Unavailable("Use of Unsafe was disabled by system property"); -@@ -2093,7 +2086,6 @@ public interface ClassInjector { - * - * @param accessResolver The access resolver to use. - */ -- @SuppressFBWarnings(value = "REC_CATCH_EXCEPTION", justification = "Exception is captured to trigger lazy error upon use.") - public Factory(AccessResolver accessResolver) { - Dispatcher.Initializable dispatcher; - if (DISPATCHER.isAvailable()) { -@@ -2151,7 +2143,6 @@ public interface ClassInjector { +@@ -2179,9 +2178,6 @@ public interface ClassInjector { * other classes within this class's module. * @return An appropriate injection strategy. */ -- @SuppressFBWarnings(value = "REC_CATCH_EXCEPTION", justification = "Exception intends to trigger disabled injection strategy.") +- @SuppressFBWarnings( +- value = {"REC_CATCH_EXCEPTION", "NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE"}, +- justification = "Exception intends to trigger disabled injection strategy. Modules are assumed if module system is supported.") public static Factory resolve(Instrumentation instrumentation, boolean local) { if (ClassInjector.UsingUnsafe.isAvailable() || !JavaModule.isSupported()) { return new Factory(); -@@ -2733,85 +2724,18 @@ public interface ClassInjector { - /** - * {@inheritDoc} - */ -- @SuppressWarnings("deprecation") - public Dispatcher run() { - if (System.getProperty("java.vm.name", "").toUpperCase(Locale.US).contains("J9")) { +@@ -2777,79 +2773,13 @@ public interface ClassInjector { return new Unavailable("J9 does not support JNA-based class definition"); } try { @@ -2168,7 +2152,7 @@ index 279b6497d2..a63ce63d5c 100644 - /** - * {@inheritDoc} - */ -- public Class defineClass(ClassLoader classLoader, String name, byte[] binaryRepresentation, ProtectionDomain protectionDomain) { +- public Class defineClass(@MaybeNull ClassLoader classLoader, String name, byte[] binaryRepresentation, @MaybeNull ProtectionDomain protectionDomain) { - return jvm.JVM_DefineClass(JNIEnv.CURRENT, - name.replace('.', '/'), - classLoader, @@ -2181,7 +2165,7 @@ index 279b6497d2..a63ce63d5c 100644 /** * An unavailable dispatcher for JNA-based class injection. */ -@@ -2846,32 +2770,6 @@ public interface ClassInjector { +@@ -2884,32 +2814,6 @@ public interface ClassInjector { throw new UnsupportedOperationException("JNA is not available and JNA-based injection cannot be used: " + error); } } @@ -2206,14 +2190,14 @@ index 279b6497d2..a63ce63d5c 100644 - @SuppressWarnings("checkstyle:methodname") - Class JVM_DefineClass(JNIEnv env, - String name, -- ClassLoader classLoader, +- @MaybeNull ClassLoader classLoader, - byte[] binaryRepresentation, - int length, -- ProtectionDomain protectionDomain) throws LastErrorException; +- @MaybeNull ProtectionDomain protectionDomain) throws LastErrorException; - } } } } -- -2.31.1 +2.33.0 diff --git a/0003-Remove-Java-14-tests.patch b/0003-Remove-Java-14-tests.patch deleted file mode 100644 index 2f88379..0000000 --- a/0003-Remove-Java-14-tests.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 9763d7d30bcbb8bf56a6682bb7362f3de33a0802 Mon Sep 17 00:00:00 2001 -From: Marian Koncek -Date: Thu, 4 Feb 2021 15:17:13 +0100 -Subject: [PATCH] Remove Java 14 tests - ---- - .../test/precompiled/SampleRecord.java | 24 ------------------- - 1 file changed, 24 deletions(-) - delete mode 100644 byte-buddy-dep/src/precompiled/java/net/bytebuddy/test/precompiled/SampleRecord.java - -diff --git a/byte-buddy-dep/src/precompiled/java/net/bytebuddy/test/precompiled/SampleRecord.java b/byte-buddy-dep/src/precompiled/java/net/bytebuddy/test/precompiled/SampleRecord.java -deleted file mode 100644 -index 522eefa..0000000 ---- a/byte-buddy-dep/src/precompiled/java/net/bytebuddy/test/precompiled/SampleRecord.java -+++ /dev/null -@@ -1,24 +0,0 @@ --/* -- * Copyright 2014 - Present Rafael Winterhalter -- * -- * Licensed under the Apache License, Version 2.0 (the "License"); -- * you may not use this file except in compliance with the License. -- * You may obtain a copy of the License at -- * -- * http://www.apache.org/licenses/LICENSE-2.0 -- * -- * Unless required by applicable law or agreed to in writing, software -- * distributed under the License is distributed on an "AS IS" BASIS, -- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- * See the License for the specific language governing permissions and -- * limitations under the License. -- */ --package net.bytebuddy.test.precompiled; -- --import net.bytebuddy.description.type.AbstractTypeDescriptionTest; -- --import java.util.List; -- --public record SampleRecord(@AbstractTypeDescriptionTest.SampleAnnotation @TypeAnnotation(42) List<@TypeAnnotation(84) String> foo) { -- /* empty */ --} --- -2.29.2 - diff --git a/0004-Remove-JDK-15-sealed-classes.patch b/0004-Remove-JDK-15-sealed-classes.patch deleted file mode 100644 index f37c67c..0000000 --- a/0004-Remove-JDK-15-sealed-classes.patch +++ /dev/null @@ -1,53 +0,0 @@ -From b7b286c16c4aba60ce47e0df3f6e97cfb005b21c Mon Sep 17 00:00:00 2001 -From: Marian Koncek -Date: Tue, 9 Nov 2021 12:23:28 +0100 -Subject: [PATCH] Remove JDK 15 sealed classes - ---- - .../bytebuddy/test/precompiled/Sealed.java | 34 ------------------- - 1 file changed, 34 deletions(-) - delete mode 100644 byte-buddy-dep/src/precompiled/java/net/bytebuddy/test/precompiled/Sealed.java - -diff --git a/byte-buddy-dep/src/precompiled/java/net/bytebuddy/test/precompiled/Sealed.java b/byte-buddy-dep/src/precompiled/java/net/bytebuddy/test/precompiled/Sealed.java -deleted file mode 100644 -index 28d9835..0000000 ---- a/byte-buddy-dep/src/precompiled/java/net/bytebuddy/test/precompiled/Sealed.java -+++ /dev/null -@@ -1,34 +0,0 @@ --/* -- * Copyright 2014 - Present Rafael Winterhalter -- * -- * Licensed under the Apache License, Version 2.0 (the "License"); -- * you may not use this file except in compliance with the License. -- * You may obtain a copy of the License at -- * -- * http://www.apache.org/licenses/LICENSE-2.0 -- * -- * Unless required by applicable law or agreed to in writing, software -- * distributed under the License is distributed on an "AS IS" BASIS, -- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- * See the License for the specific language governing permissions and -- * limitations under the License. -- */ --package net.bytebuddy.test.precompiled; -- --public sealed class Sealed permits Sealed.SubNonSealed, Sealed.SubSealed, Sealed.SubFinal { -- -- public static non-sealed class SubNonSealed extends Sealed { -- /* empty */ -- } -- -- public static sealed class SubSealed extends Sealed permits SubSealed.SubSubFinal { -- -- public static final class SubSubFinal extends SubSealed { -- /* empty */ -- } -- } -- -- public static final class SubFinal extends Sealed { -- /* empty */ -- } --} --- -2.31.1 - diff --git a/byte-buddy-1.12.0.tar.gz b/byte-buddy-1.12.0.tar.gz deleted file mode 100644 index e390c5a..0000000 Binary files a/byte-buddy-1.12.0.tar.gz and /dev/null differ diff --git a/byte-buddy-1.14.2.tar.gz b/byte-buddy-1.14.2.tar.gz new file mode 100644 index 0000000..7d1b9a9 Binary files /dev/null and b/byte-buddy-1.14.2.tar.gz differ diff --git a/byte-buddy.spec b/byte-buddy.spec index 7be6002..8139e45 100644 --- a/byte-buddy.spec +++ b/byte-buddy.spec @@ -1,19 +1,19 @@ %bcond_with bootstrap Name: byte-buddy -Version: 1.12.0 +Version: 1.14.2 Release: 1 Summary: Runtime code generation for the Java virtual machine License: Apache-2.0 URL: http://bytebuddy.net/ Source0: https://github.com/raphw/byte-buddy/archive/byte-buddy-%{version}.tar.gz Source1: xmvn-reactor + Patch0: 0001-Avoid-bundling-asm.patch Patch1: 0002-Remove-dependencies.patch -Patch2: 0003-Remove-Java-14-tests.patch -Patch3: 0004-Remove-JDK-15-sealed-classes.patch BuildRequires: maven-local BuildRequires: java-1.8.0-openjdk-devel maven + Requires: byte-buddy-agent byte-buddy-maven-plugin byte-buddy-parent BuildArch: noarch @@ -53,20 +53,14 @@ Summary: Javadoc for %{name} This package contains API documentation for %{name}. %prep -%setup -q -n %{name}-%{name}-%{version} -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 +%autosetup -n %{name}-%{name}-%{version} -p1 + +find -name '*.class' -delete rm byte-buddy-agent/src/test/java/net/bytebuddy/agent/VirtualMachineAttachmentTest.java rm byte-buddy-agent/src/test/java/net/bytebuddy/agent/VirtualMachineForOpenJ9Test.java +rm byte-buddy-agent/src/test/java/net/bytebuddy/test/utility/JnaRule.java -mv byte-buddy-dep/src/precompiled/java/net/bytebuddy/build/*.java \ - byte-buddy-dep/src/main/java/net/bytebuddy/build -mkdir -p byte-buddy-dep/src/test/java/net/bytebuddy/test/precompiled/ -mv byte-buddy-dep/src/precompiled/java/net/bytebuddy/test/precompiled/*.java \ - byte-buddy-dep/src/test/java/net/bytebuddy/test/precompiled/ %pom_disable_module byte-buddy-android %pom_disable_module byte-buddy-android-test %pom_disable_module byte-buddy-benchmark @@ -78,7 +72,6 @@ mv byte-buddy-dep/src/precompiled/java/net/bytebuddy/test/precompiled/*.java \ %pom_remove_plugin :coveralls-maven-plugin %pom_remove_plugin :spotbugs-maven-plugin %pom_remove_plugin :jitwatch-jarscan-maven-plugin -%pom_remove_plugin :clirr-maven-plugin %pom_remove_plugin :maven-release-plugin %pom_remove_plugin :nexus-staging-maven-plugin %pom_remove_plugin :byte-buddy-maven-plugin byte-buddy-dep @@ -86,18 +79,13 @@ mv byte-buddy-dep/src/precompiled/java/net/bytebuddy/test/precompiled/*.java \ %pom_xpath_set "pom:createSourcesJar" "false" byte-buddy %pom_remove_dep :findbugs-annotations sed -i -e '/SuppressFBWarnings/d' $(grep -lr SuppressFBWarnings) -%pom_remove_plugin -r :modulemaker-maven-plugin %pom_remove_dep org.ow2.asm:asm-deprecated -%pom_remove_plugin :maven-shade-plugin byte-buddy -%pom_remove_plugin :maven-shade-plugin byte-buddy-benchmark -%pom_remove_dep net.java.dev.jna:jna byte-buddy -%pom_remove_dep net.java.dev.jna:jna byte-buddy-dep -%pom_remove_dep net.java.dev.jna:jna byte-buddy-agent -%pom_remove_dep net.java.dev.jna:jna-platform byte-buddy -%pom_remove_dep net.java.dev.jna:jna-platform byte-buddy-dep -%pom_remove_dep net.java.dev.jna:jna-platform byte-buddy-agent - + +%pom_remove_plugin -r :maven-shade-plugin +%pom_remove_dep -r net.java.dev.jna:jna +%pom_remove_dep -r net.java.dev.jna:jna-platform + cp %{SOURCE1} ./.xmvn-reactor echo `pwd` > absolute_prefix.log sed -i 's/\//\\\//g' absolute_prefix.log @@ -146,6 +134,9 @@ mvn package -Dsourcecode.test.version=1.8 -Dmaven.test.failure.ignore=true -P'ja %license LICENSE NOTICE %changelog +* Wed Aug 02 2023 xu_ping <707078654@qq.com> - 1.14.2-1 +- Upgrade to version 1.14.2 + * Thu Jun 16 2022 Ge Wang - 1.12.0-1 - Upgrade to version 1.12.0 diff --git a/xmvn-reactor b/xmvn-reactor index a0a4683..9d12df1 100644 --- a/xmvn-reactor +++ b/xmvn-reactor @@ -5,7 +5,7 @@ net.bytebuddy byte-buddy-parent pom - 1.12.0 + 1.14.2 absolute-prefix/pom.xml pom @@ -14,8 +14,8 @@ net.bytebuddy byte-buddy-agent - 1.12.0 - absolute-prefix/byte-buddy-agent/target/byte-buddy-agent-1.12.0.jar + 1.14.2 + absolute-prefix/byte-buddy-agent/target/byte-buddy-agent-1.14.2.jar jar 1.8 @@ -25,7 +25,7 @@ net.bytebuddy byte-buddy-agent pom - 1.12.0 + 1.14.2 absolute-prefix/byte-buddy-agent/pom.xml jar @@ -35,8 +35,8 @@ net.bytebuddy byte-buddy-dep - 1.12.0 - absolute-prefix/byte-buddy-dep/target/byte-buddy-dep-1.12.0.jar + 1.14.2 + absolute-prefix/byte-buddy-dep/target/byte-buddy-dep-1.14.2.jar jar 1.8 @@ -68,7 +68,7 @@ net.bytebuddy byte-buddy-dep pom - 1.12.0 + 1.14.2 absolute-prefix/byte-buddy-dep/pom.xml jar @@ -100,8 +100,8 @@ net.bytebuddy byte-buddy - 1.12.0 - absolute-prefix/byte-buddy/target/byte-buddy-1.12.0.jar + 1.14.2 + absolute-prefix/byte-buddy/target/byte-buddy-1.14.2.jar jar 1.8 @@ -110,7 +110,7 @@ net.bytebuddy byte-buddy-dep - 1.12.0 + 1.14.2 org.ow2.asm @@ -128,7 +128,7 @@ net.bytebuddy byte-buddy pom - 1.12.0 + 1.14.2 absolute-prefix/byte-buddy/pom.xml jar @@ -138,7 +138,7 @@ net.bytebuddy byte-buddy-dep - 1.12.0 + 1.14.2 org.ow2.asm @@ -155,8 +155,8 @@ net.bytebuddy byte-buddy-maven-plugin - 1.12.0 - absolute-prefix/byte-buddy-maven-plugin/target/byte-buddy-maven-plugin-1.12.0.jar + 1.14.2 + absolute-prefix/byte-buddy-maven-plugin/target/byte-buddy-maven-plugin-1.14.2.jar maven-plugin 1.8 @@ -165,7 +165,7 @@ net.bytebuddy byte-buddy - 1.12.0 + 1.14.2 org.apache.maven @@ -188,7 +188,7 @@ net.bytebuddy byte-buddy-maven-plugin pom - 1.12.0 + 1.14.2 absolute-prefix/byte-buddy-maven-plugin/pom.xml maven-plugin @@ -198,7 +198,7 @@ net.bytebuddy byte-buddy - 1.12.0 + 1.14.2 org.apache.maven