mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-13 08:15:48 +00:00
[issue #1218] Annotation Processors that have an (internal) dependency on ecj (google's dagger project has this, don't know of any others), when run inside eclipse, bombs with a LinkageError. Fixed.
This commit is contained in:
1 parent
49f0bc1c3e
commit
192c569128
4 files changed
+16
-3
No files matched your search
+2
-2
@@ -1,5 +1,5 @@
|
||||
<ivy-module version="2.0">
|
||||
<info organisation="org.projectlombok" module="lombok.patcher" revision="0.20" publication="20150408000000">
|
||||
<info organisation="org.projectlombok" module="lombok.patcher" revision="0.22" publication="20161107000000">
|
||||
<license name="MIT License" url="http://www.opensource.org/licenses/mit-license.php" />
|
||||
<ivyauthor name="rzwitserloot" url="http://zwitserloot.com/" />
|
||||
<ivyauthor name="rspilker" url="http://github.com/rspilker" />
|
||||
@@ -9,6 +9,6 @@
|
||||
<conf name="default" />
|
||||
</configurations>
|
||||
<publications>
|
||||
<artifact conf="default" url="https://projectlombok.org/downloads/lombok.patcher-0.20.jar" />
|
||||
<artifact conf="default" url="https://projectlombok.org/downloads/lombok.patcher-0.22.jar" />
|
||||
</publications>
|
||||
</ivy-module>
|
||||
@@ -15,7 +15,7 @@
|
||||
<conf name="javac7" />
|
||||
</configurations>
|
||||
<dependencies>
|
||||
<dependency org="org.projectlombok" name="lombok.patcher" rev="0.20" conf="buildBase->default; runtime->default" />
|
||||
<dependency org="org.projectlombok" name="lombok.patcher" rev="0.22" conf="buildBase->default; runtime->default" />
|
||||
<dependency org="zwitserloot.com" name="cmdreader" rev="1.2" conf="buildBase->runtime; runtime" />
|
||||
|
||||
<dependency org="junit" name="junit" rev="4.8.2" conf="test->default; contrib->sources" />
|
||||
|
||||
@@ -3,6 +3,7 @@ Lombok Changelog
|
||||
|
||||
### v1.16.11 "Edgy Guinea Pig"
|
||||
* v1.16.10 is the latest release
|
||||
* BUGFIX: Annotation Processors that use ecj internally (dagger) no longer give linkage errors [Issue #1218](https://github.com/rzwitserloot/lombok/issues/1218)
|
||||
* BUGFIX: `val` in lambda expressions now work as expected [Issue #911](https://github.com/rzwitserloot/lombok/issues/911)
|
||||
* PLATFORM: Red Hat JBoss Developer Studio is now correctly identified by the installer [Issue #1164](https://github.com/rzwitserloot/lombok/issues/1164)
|
||||
* BUGFIX: delombok: for-loops with initializers that are not local variables would be generated incorrectly [Issue #1076](https://github.com/rzwitserloot/lombok/issues/1076)
|
||||
|
||||
@@ -24,11 +24,14 @@ package lombok.eclipse.agent;
|
||||
import static lombok.patcher.scripts.ScriptBuilder.*;
|
||||
|
||||
import java.lang.instrument.Instrumentation;
|
||||
import java.net.URLClassLoader;
|
||||
import java.security.ProtectionDomain;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.core.AgentLauncher;
|
||||
import lombok.patcher.Filter;
|
||||
import lombok.patcher.Hook;
|
||||
import lombok.patcher.MethodTarget;
|
||||
import lombok.patcher.ScriptManager;
|
||||
@@ -74,6 +77,15 @@ public class EclipsePatcher implements AgentLauncher.AgentLaunchable {
|
||||
private static void registerPatchScripts(Instrumentation instrumentation, boolean reloadExistingClasses, boolean ecjOnly, Class<?> launchingContext) {
|
||||
ScriptManager sm = new ScriptManager();
|
||||
sm.registerTransformer(instrumentation);
|
||||
sm.setFilter(new Filter() {
|
||||
@Override public boolean shouldTransform(ClassLoader loader, String className, Class<?> classBeingDefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) {
|
||||
if (!(loader instanceof URLClassLoader)) return true;
|
||||
ClassLoader parent = loader.getParent();
|
||||
if (parent == null) return true;
|
||||
return !parent.getClass().getName().startsWith("org.eclipse.jdt.apt.core.internal.AnnotationProcessorFactoryLoader");
|
||||
}
|
||||
});
|
||||
|
||||
final boolean forceBaseResourceNames = !"".equals(System.getProperty("shadow.override.lombok", ""));
|
||||
sm.setTransplantMapper(new TransplantMapper() {
|
||||
public String mapResourceName(int classFileFormatVersion, String resourceName) {
|
||||
|
||||
Reference in new issue
Block a user