From a4441fb931fe1711d410b3b769e0f140b8c9670e Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Wed, 8 Apr 2015 22:56:32 +0200 Subject: Updated to patcher 0.20 with updates for bugs where you’d type a quote and then eclipse would hang. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lombok/eclipse/agent/EclipseLoaderPatcherTransplants.java | 8 +++++--- src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java | 5 +++-- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'src/eclipseAgent/lombok/eclipse/agent') 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; } }); -- cgit