diff options
author | Christian Nüssgens <christian@nuessgens.com> | 2018-03-28 19:13:10 +0200 |
---|---|---|
committer | Christian Nüssgens <christian@nuessgens.com> | 2018-03-28 19:13:10 +0200 |
commit | 96cd4f5010d30aa08835f592403e6a7aceb23e46 (patch) | |
tree | 978a3672dd32d78e9eeef8caf28dba63fc7dce8c /src/eclipseAgent/lombok/eclipse/agent | |
parent | 06da0854e93df222603fcc2e51c9594c16899087 (diff) | |
parent | af9861ad9f7151c6d12f56ecf11d7ce10826201a (diff) | |
download | lombok-96cd4f5010d30aa08835f592403e6a7aceb23e46.tar.gz lombok-96cd4f5010d30aa08835f592403e6a7aceb23e46.tar.bz2 lombok-96cd4f5010d30aa08835f592403e6a7aceb23e46.zip |
Merge remote-tracking branch 'remotes/upstream/master'
Diffstat (limited to 'src/eclipseAgent/lombok/eclipse/agent')
-rw-r--r-- | src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java b/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java index d3477c1f..a6d745b6 100644 --- a/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java +++ b/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java @@ -23,6 +23,7 @@ package lombok.eclipse.agent; import static lombok.patcher.scripts.ScriptBuilder.*; +import java.io.File; import java.lang.instrument.Instrumentation; import java.net.URLClassLoader; import java.security.ProtectionDomain; @@ -86,7 +87,7 @@ public class EclipsePatcher implements AgentLauncher.AgentLaunchable { } }); - final boolean forceBaseResourceNames = !"".equals(System.getProperty("shadow.override.lombok", "")); + final boolean forceBaseResourceNames = shouldForceBaseResourceNames(); sm.setTransplantMapper(new TransplantMapper() { public String mapResourceName(int classFileFormatVersion, String resourceName) { if (classFileFormatVersion < 50 || forceBaseResourceNames) return resourceName; @@ -125,6 +126,15 @@ public class EclipsePatcher implements AgentLauncher.AgentLaunchable { if (reloadExistingClasses) sm.reloadClasses(instrumentation); } + private static boolean shouldForceBaseResourceNames() { + String shadowOverride = System.getProperty("shadow.override.lombok", ""); + if (shadowOverride == null || shadowOverride.length() == 0) return false; + for (String part : shadowOverride.split("\\s*" + (File.pathSeparatorChar == ';' ? ";" : ":") + "\\s*")) { + if (part.equalsIgnoreCase("lombok.jar")) return false; + } + return true; + } + private static void patchRenameField(ScriptManager sm) { /* RefactoringSearchEngine.search will not return results when renaming field and Data Annotation is present. Return a fake Element to make checks pass */ sm.addScript(ScriptBuilder.wrapMethodCall() |