From c72e2a273233719750af0f41e842f705292888ac Mon Sep 17 00:00:00 2001 From: Roel Spilker Date: Thu, 20 Feb 2014 21:03:13 +0100 Subject: [suspect:eclipse] Fix for issue 633: refactor script 'extract local variable' did not work inside for example SneakyThrows-protected methods. This fix is reverting the change in e835daa9. During conversion of the internal.ast to the dom AST, a flag is introduced named 'ORIGINAL'. Commit e835daa9 always explicitly cleared it for all lombok-generated nodes, in an attempt to try and do the appropriate thing, treating the ORIGINAL flag as a simile for 'generated code'. Unfortunately, for eclipse code analysis, all our generated code should be treated as if it's "really" there, and in general this doesn't work because eclipse's concept of 'generated' applies to explicit super() calls and the like, not the kind of stuff lombok introduces. --- src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src') diff --git a/src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java b/src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java index d4b8c763..2370d3ff 100644 --- a/src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java +++ b/src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java @@ -256,10 +256,7 @@ public class PatchFixes { org.eclipse.jdt.internal.compiler.ast.ASTNode internalNode) throws Exception { if (internalNode == null || domNode == null) return; boolean isGenerated = internalNode.getClass().getField("$generatedBy").get(internalNode) != null; - if (isGenerated) { - domNode.getClass().getField("$isGenerated").set(domNode, true); - domNode.setFlags(domNode.getFlags() & ~org.eclipse.jdt.core.dom.ASTNode.ORIGINAL); - } + if (isGenerated) domNode.getClass().getField("$isGenerated").set(domNode, true); } public static void setIsGeneratedFlagForName(org.eclipse.jdt.core.dom.Name name, Object internalNode) throws Exception { -- cgit