diff options
author | Roel Spilker <r.spilker@gmail.com> | 2015-01-21 02:07:56 +0100 |
---|---|---|
committer | Roel Spilker <r.spilker@gmail.com> | 2015-01-21 02:07:56 +0100 |
commit | 7bb2ed02c3891d240840110abb0a79949947cc16 (patch) | |
tree | d8f3a6e1b088153ed65fd4f1c19f761d11e6571a | |
parent | 6f76123a571c69d4c2c533f1c6c2abdc080cd905 (diff) | |
download | lombok-7bb2ed02c3891d240840110abb0a79949947cc16.tar.gz lombok-7bb2ed02c3891d240840110abb0a79949947cc16.tar.bz2 lombok-7bb2ed02c3891d240840110abb0a79949947cc16.zip |
[i742][i747] Fix for ExtensionMethod broken in Eclipse using java8
-rw-r--r-- | doc/changelog.markdown | 1 | ||||
-rw-r--r-- | src/eclipseAgent/lombok/eclipse/agent/PatchExtensionMethod.java | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/doc/changelog.markdown b/doc/changelog.markdown index e7dc910d..1f0425aa 100644 --- a/doc/changelog.markdown +++ b/doc/changelog.markdown @@ -2,6 +2,7 @@ Lombok Changelog ---------------- ### v1.14.9.shadow "<del>Edgy</del> Shadowy Guinea Pig" +* BUGFIX: `@ExtensionMethod` was broken in Eclipse using java 8. [Issue #742](https://code.google.com/p/projectlombok/issues/detail?id=742), [Issue #747](https://code.google.com/p/projectlombok/issues/detail?id=747) * Added a launcher to the lombok boot process which removes the need for `-Xbootclasspath` to be in your `eclipse.ini` file, and removes all non-public API and third party dependencies (such as ASM) from the lombok jar, thus removing them from your IDE's auto complete offerings in any project that uses lombok. For those debugging lombok, the launcher enables hot code replace which makes debugging a lot easier, as previously one was required to shut down the IDE, rebuild the jar, and relaunch. Add `-Dshadow.override.lombok=/path/to/lombok/bin` to the launch target for hot code replace. * BUGFIX: delombok: Using exotic characters in your source files would overzealously backslash-u escape them. Now, all characters are printed unescaped, assuming your chosen encoding can support them. Otherwise, they are escaped. [Issue #759](https://code.google.com/p/projectlombok/issues/detail?id=759) diff --git a/src/eclipseAgent/lombok/eclipse/agent/PatchExtensionMethod.java b/src/eclipseAgent/lombok/eclipse/agent/PatchExtensionMethod.java index 44adb333..ca0933fb 100644 --- a/src/eclipseAgent/lombok/eclipse/agent/PatchExtensionMethod.java +++ b/src/eclipseAgent/lombok/eclipse/agent/PatchExtensionMethod.java @@ -227,8 +227,11 @@ public class PatchExtensionMethod { if (argument.resolvedType != null) argumentTypes.add(argument.resolvedType); // TODO: Instead of just skipping nulls entirely, there is probably a 'unresolved type' placeholder. THAT is what we ought to be adding here! } + Expression[] originalArgs = methodCall.arguments; + methodCall.arguments = arguments.toArray(new Expression[0]); MethodBinding fixedBinding = scope.getMethod(extensionMethod.declaringClass, methodCall.selector, argumentTypes.toArray(new TypeBinding[0]), methodCall); if (fixedBinding instanceof ProblemMethodBinding) { + methodCall.arguments = originalArgs; if (fixedBinding.declaringClass != null) { scope.problemReporter().invalidMethod(methodCall, fixedBinding); } @@ -247,7 +250,6 @@ public class PatchExtensionMethod { arg.implicitConversion = TypeIds.UNBOXING | (id + (id << 4)); // magic see TypeIds } } - methodCall.arguments = arguments.toArray(new Expression[0]); methodCall.receiver = createNameRef(extensionMethod.declaringClass, methodCall); methodCall.actualReceiverType = extensionMethod.declaringClass; |