From ab117a9fe31902167b9a74fee1982068e4c4d095 Mon Sep 17 00:00:00 2001 From: chibash Date: Wed, 31 May 2017 17:44:26 +0900 Subject: delete testHotswap() because java 9 does not seem to allow a java agent to be attached after the JVM starts --- javassist.jar | Bin 727942 -> 727192 bytes src/main/javassist/util/HotSwapAgent.java | 3 +-- src/test/javassist/HotswapTest.java | 4 ++++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/javassist.jar b/javassist.jar index ce389bac..2f0ef0fb 100644 Binary files a/javassist.jar and b/javassist.jar differ diff --git a/src/main/javassist/util/HotSwapAgent.java b/src/main/javassist/util/HotSwapAgent.java index 5bfbe53c..f9c3a836 100644 --- a/src/main/javassist/util/HotSwapAgent.java +++ b/src/main/javassist/util/HotSwapAgent.java @@ -149,9 +149,8 @@ public class HotSwapAgent { String nameOfRunningVM = ManagementFactory.getRuntimeMXBean().getName(); String pid = nameOfRunningVM.substring(0, nameOfRunningVM.indexOf('@')); - VirtualMachine vm = VirtualMachine.attach(pid); - vm.loadAgent(agentJar.getAbsolutePath(), ""); + vm.loadAgent(agentJar.getAbsolutePath(), null); vm.detach(); } catch (Exception e) { diff --git a/src/test/javassist/HotswapTest.java b/src/test/javassist/HotswapTest.java index 8b4db598..deab8fad 100644 --- a/src/test/javassist/HotswapTest.java +++ b/src/test/javassist/HotswapTest.java @@ -18,6 +18,10 @@ public class HotswapTest extends TestCase { } public void testHotswap() throws Exception { + if (javassist.bytecode.ClassFile.MAJOR_VERSION + >= javassist.bytecode.ClassFile.JAVA_9) + return; + Foo f = new Foo(); assertEquals(1, f.foo()); -- cgit v1.2.3