aboutsummaryrefslogtreecommitdiff
path: root/src/eclipseAgent
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2015-04-08 22:56:32 +0200
committerReinier Zwitserloot <reinier@zwitserloot.com>2015-04-08 23:06:42 +0200
commita4441fb931fe1711d410b3b769e0f140b8c9670e (patch)
tree68f2e940b964bbcd0211b850ba927335681a8d52 /src/eclipseAgent
parenteb3c98a6750a4ff7c23f23c10bdb5d2d8afcc6c6 (diff)
downloadlombok-a4441fb931fe1711d410b3b769e0f140b8c9670e.tar.gz
lombok-a4441fb931fe1711d410b3b769e0f140b8c9670e.tar.bz2
lombok-a4441fb931fe1711d410b3b769e0f140b8c9670e.zip
Updated to patcher 0.20 with updates for bugs where you’d type a quote and then eclipse would hang.
Diffstat (limited to 'src/eclipseAgent')
-rw-r--r--src/eclipseAgent/lombok/eclipse/agent/EclipseLoaderPatcherTransplants.java8
-rw-r--r--src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java5
2 files changed, 8 insertions, 5 deletions
diff --git a/src/eclipseAgent/lombok/eclipse/agent/EclipseLoaderPatcherTransplants.java b/src/eclipseAgent/lombok/eclipse/agent/EclipseLoaderPatcherTransplants.java
index b1327216..ea72f56a 100644
--- a/src/eclipseAgent/lombok/eclipse/agent/EclipseLoaderPatcherTransplants.java
+++ b/src/eclipseAgent/lombok/eclipse/agent/EclipseLoaderPatcherTransplants.java
@@ -26,6 +26,7 @@ import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
+import java.util.Arrays;
import java.util.jar.JarFile;
import java.util.zip.ZipEntry;
@@ -92,14 +93,15 @@ public class EclipseLoaderPatcherTransplants {
jf.close();
}
}
- Class[] paramTypes = new Class[4];
+ Class[] paramTypes = new Class[5];
paramTypes[0] = classLoaderClass;
paramTypes[1] = "".getClass();
paramTypes[2] = paramTypes[1];
- paramTypes[3] = new String[0].getClass();
+ paramTypes[3] = Class.forName("java.util.List");
+ paramTypes[4] = paramTypes[3];
Constructor constructor = shadowClassLoaderClass.getDeclaredConstructor(paramTypes);
constructor.setAccessible(true);
- shadowLoader = (ClassLoader) constructor.newInstance(new Object[] {original, "lombok", jarLoc, new String[] {"lombok."}});
+ shadowLoader = (ClassLoader) constructor.newInstance(new Object[] {original, "lombok", jarLoc, Arrays.asList(new Object[] {"lombok."}), Arrays.asList(new Object[] {"lombok.patcher.Symbols"})});
shadowLoaderField.set(original, shadowLoader);
}
}
diff --git a/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java b/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java
index 28e8d0c1..6e5871e6 100644
--- a/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java
+++ b/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java
@@ -75,8 +75,9 @@ public class EclipsePatcher implements AgentLauncher.AgentLaunchable {
ScriptManager sm = new ScriptManager();
sm.registerTransformer(instrumentation);
sm.setTransplantMapper(new TransplantMapper() {
- public String getPrefixFor(int classFileFormatVersion) {
- return classFileFormatVersion > 49 ? "Class50/" : "";
+ public String mapResourceName(int classFileFormatVersion, String resourceName) {
+ if (classFileFormatVersion < 50) return resourceName;
+ return "Class50/" + resourceName;
}
});