diff options
author | Ivan Dubrov <idubrov@guidewire.com> | 2014-04-25 10:12:58 -0700 |
---|---|---|
committer | Ivan Dubrov <idubrov@guidewire.com> | 2014-04-25 10:12:58 -0700 |
commit | 9cc2c3411ab71ff407e261e0dd7122a8c2dd5751 (patch) | |
tree | ea8be78844796b18025a9671a30225cc6a7059c9 /dcevm/src/main | |
parent | 53efb2be51b7cdc1519a7bedef9402fe59650ef7 (diff) | |
download | dcevm-9cc2c3411ab71ff407e261e0dd7122a8c2dd5751.tar.gz dcevm-9cc2c3411ab71ff407e261e0dd7122a8c2dd5751.zip |
Renaming org.dcevm -> com.github.dcevm
Well, dcevm.org domain is lost, so let's use com.github.dcevm for now.
Diffstat (limited to 'dcevm/src/main')
-rw-r--r-- | dcevm/src/main/java/com/github/dcevm/ClassRedefinitionPolicy.java (renamed from dcevm/src/main/java/org/dcevm/ClassRedefinitionPolicy.java) | 2 | ||||
-rw-r--r-- | dcevm/src/main/java/com/github/dcevm/HotSwapTool.java (renamed from dcevm/src/main/java/org/dcevm/HotSwapTool.java) | 2 | ||||
-rw-r--r-- | dcevm/src/main/java/com/github/dcevm/InstrumentationRedefiner.java | 31 | ||||
-rw-r--r-- | dcevm/src/main/java/com/github/dcevm/JDIRedefiner.java (renamed from dcevm/src/main/java/org/dcevm/JDIRedefiner.java) | 2 | ||||
-rw-r--r-- | dcevm/src/main/java/com/github/dcevm/Redefiner.java (renamed from dcevm/src/main/java/org/dcevm/Redefiner.java) | 2 | ||||
-rw-r--r-- | dcevm/src/main/java/com/github/dcevm/TestClassAdapter.java (renamed from dcevm/src/main/java/org/dcevm/TestClassAdapter.java) | 2 | ||||
-rw-r--r-- | dcevm/src/main/java/org/dcevm/InstrumentationRedefiner.java | 54 |
7 files changed, 36 insertions, 59 deletions
diff --git a/dcevm/src/main/java/org/dcevm/ClassRedefinitionPolicy.java b/dcevm/src/main/java/com/github/dcevm/ClassRedefinitionPolicy.java index 32571863..4fd1be8a 100644 --- a/dcevm/src/main/java/org/dcevm/ClassRedefinitionPolicy.java +++ b/dcevm/src/main/java/com/github/dcevm/ClassRedefinitionPolicy.java @@ -21,7 +21,7 @@ * questions. * */ -package org.dcevm; +package com.github.dcevm; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; diff --git a/dcevm/src/main/java/org/dcevm/HotSwapTool.java b/dcevm/src/main/java/com/github/dcevm/HotSwapTool.java index b622cba9..72d77590 100644 --- a/dcevm/src/main/java/org/dcevm/HotSwapTool.java +++ b/dcevm/src/main/java/com/github/dcevm/HotSwapTool.java @@ -21,7 +21,7 @@ * questions. * */ -package org.dcevm; +package com.github.dcevm; import org.objectweb.asm.ClassReader; import org.objectweb.asm.ClassWriter; diff --git a/dcevm/src/main/java/com/github/dcevm/InstrumentationRedefiner.java b/dcevm/src/main/java/com/github/dcevm/InstrumentationRedefiner.java new file mode 100644 index 00000000..42215435 --- /dev/null +++ b/dcevm/src/main/java/com/github/dcevm/InstrumentationRedefiner.java @@ -0,0 +1,31 @@ +package com.github.dcevm; + + +import com.github.dcevm.agent.InstrumentationAgent; + +import java.io.IOException; +import java.lang.instrument.ClassDefinition; +import java.lang.instrument.Instrumentation; +import java.lang.instrument.UnmodifiableClassException; +import java.util.Map; + +public class InstrumentationRedefiner implements Redefiner { + public void redefineClasses(Map<Class<?>, byte[]> classes) throws ClassNotFoundException, UnmodifiableClassException { + Instrumentation instrumentation = InstrumentationAgent.INSTRUMENTATION; + if (instrumentation == null) { + throw new IllegalStateException("Instrumentation agent is not properly installed!"); + } + + ClassDefinition[] definitions = new ClassDefinition[classes.size()]; + int i = 0; + for (Map.Entry<Class<?>, byte[]> entry : classes.entrySet()) { + definitions[i++] = new ClassDefinition(entry.getKey(), entry.getValue()); + } + instrumentation.redefineClasses(definitions); + } + + @Override + public void close() throws IOException { + // Do nothing. + } +} diff --git a/dcevm/src/main/java/org/dcevm/JDIRedefiner.java b/dcevm/src/main/java/com/github/dcevm/JDIRedefiner.java index 6fc742d4..a28444bc 100644 --- a/dcevm/src/main/java/org/dcevm/JDIRedefiner.java +++ b/dcevm/src/main/java/com/github/dcevm/JDIRedefiner.java @@ -21,7 +21,7 @@ * questions. * */ -package org.dcevm; +package com.github.dcevm; import com.sun.jdi.Bootstrap; import com.sun.jdi.ReferenceType; diff --git a/dcevm/src/main/java/org/dcevm/Redefiner.java b/dcevm/src/main/java/com/github/dcevm/Redefiner.java index cd183fe3..620ab263 100644 --- a/dcevm/src/main/java/org/dcevm/Redefiner.java +++ b/dcevm/src/main/java/com/github/dcevm/Redefiner.java @@ -21,7 +21,7 @@ * questions. * */ -package org.dcevm; +package com.github.dcevm; import java.io.Closeable; import java.lang.instrument.UnmodifiableClassException; diff --git a/dcevm/src/main/java/org/dcevm/TestClassAdapter.java b/dcevm/src/main/java/com/github/dcevm/TestClassAdapter.java index bd4b2daf..aadf1b22 100644 --- a/dcevm/src/main/java/org/dcevm/TestClassAdapter.java +++ b/dcevm/src/main/java/com/github/dcevm/TestClassAdapter.java @@ -21,7 +21,7 @@ * questions. * */ -package org.dcevm; +package com.github.dcevm; import org.objectweb.asm.ClassVisitor; import org.objectweb.asm.MethodVisitor; diff --git a/dcevm/src/main/java/org/dcevm/InstrumentationRedefiner.java b/dcevm/src/main/java/org/dcevm/InstrumentationRedefiner.java deleted file mode 100644 index 247fbb2e..00000000 --- a/dcevm/src/main/java/org/dcevm/InstrumentationRedefiner.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ -package org.dcevm; - - -import org.dcevm.agent.InstrumentationAgent; - -import java.io.IOException; -import java.lang.instrument.ClassDefinition; -import java.lang.instrument.Instrumentation; -import java.lang.instrument.UnmodifiableClassException; -import java.util.Map; - -public class InstrumentationRedefiner implements Redefiner { - public void redefineClasses(Map<Class<?>, byte[]> classes) throws ClassNotFoundException, UnmodifiableClassException { - Instrumentation instrumentation = InstrumentationAgent.INSTRUMENTATION; - if (instrumentation == null) { - throw new IllegalStateException("Instrumentation agent is not properly installed!"); - } - - ClassDefinition[] definitions = new ClassDefinition[classes.size()]; - int i = 0; - for (Map.Entry<Class<?>, byte[]> entry : classes.entrySet()) { - definitions[i++] = new ClassDefinition(entry.getKey(), entry.getValue()); - } - instrumentation.redefineClasses(definitions); - } - - @Override - public void close() throws IOException { - // Do nothing. - } -} |