From 1b534d17d39f687d42ebab733327a59c3466a949 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Sat, 3 Oct 2020 23:51:33 +0200 Subject: Untangling patches to classes that only exist in eclipse, not ecj Specifically, Rawi01's patches to make javadoc behaviour in eclipse better, which cannot be applied to ecj as you get load errors (javadoc not a thing there). As part of this commit, tests can be limited to ecj or eclipse, and I made cut-down versions of a few tests (to run on ecj, as the main one cannot be, due to javadoc issues). The tests now marked as eclipse only don't fail on ecj, but they don't generate the same result. Alternatively, we could go with a separated out after-ecj and after-eclipse dir instead, but that's perhaps going overboard. --- src/core/lombok/eclipse/EcjAugments.java | 54 ++++++++++++++++++++++ src/core/lombok/eclipse/EclipseAugments.java | 47 ------------------- src/core/lombok/eclipse/HandlerLibrary.java | 2 +- .../eclipse/handlers/EclipseHandlerUtil.java | 46 ++++++++++++------ .../lombok/javac/handlers/JavacHandlerUtil.java | 54 ++++++++++++++++------ .../lombok/eclipse/agent/EclipsePatcher.java | 11 +++-- .../lombok/eclipse/agent/PatchDelegate.java | 6 +-- .../lombok/eclipse/agent/PatchJavadoc.java | 7 ++- .../lombok/launch/PatchFixesHider.java | 10 ++-- 9 files changed, 146 insertions(+), 91 deletions(-) create mode 100644 src/core/lombok/eclipse/EcjAugments.java delete mode 100644 src/core/lombok/eclipse/EclipseAugments.java (limited to 'src') diff --git a/src/core/lombok/eclipse/EcjAugments.java b/src/core/lombok/eclipse/EcjAugments.java new file mode 100644 index 00000000..965c4fb6 --- /dev/null +++ b/src/core/lombok/eclipse/EcjAugments.java @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2014 The Project Lombok Authors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package lombok.eclipse; + +import java.util.Map; +import java.util.List; +import java.util.concurrent.ConcurrentMap; + +import org.eclipse.jdt.internal.compiler.ast.ASTNode; +import org.eclipse.jdt.internal.compiler.ast.Annotation; +import org.eclipse.jdt.internal.compiler.ast.FieldDeclaration; +import org.eclipse.jdt.internal.core.CompilationUnit; +import org.eclipse.jdt.internal.core.SourceMethod; + +import lombok.core.FieldAugment; + +public final class EcjAugments { + private EcjAugments() { + // Prevent instantiation + } + + public static final FieldAugment FieldDeclaration_booleanLazyGetter = FieldAugment.augment(FieldDeclaration.class, boolean.class, "lombok$booleanLazyGetter"); + public static final FieldAugment ASTNode_handled = FieldAugment.augment(ASTNode.class, boolean.class, "lombok$handled"); + public static final FieldAugment ASTNode_generatedBy = FieldAugment.augment(ASTNode.class, ASTNode.class, "$generatedBy"); + public static final FieldAugment Annotation_applied = FieldAugment.augment(Annotation.class, boolean.class, "lombok$applied"); + + public static final class EclipseAugments { + private EclipseAugments() { + // Prevent instantiation + } + + public static final FieldAugment> CompilationUnit_javadoc = FieldAugment.augment(CompilationUnit.class, Map.class, "$javadoc"); + public static final FieldAugment>> CompilationUnit_delegateMethods = FieldAugment.augment(CompilationUnit.class, ConcurrentMap.class, "$delegateMethods"); + } +} diff --git a/src/core/lombok/eclipse/EclipseAugments.java b/src/core/lombok/eclipse/EclipseAugments.java deleted file mode 100644 index 783e25c9..00000000 --- a/src/core/lombok/eclipse/EclipseAugments.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2014 The Project Lombok Authors. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package lombok.eclipse; - -import java.util.Map; -import java.util.List; -import java.util.concurrent.ConcurrentMap; - -import org.eclipse.jdt.internal.compiler.ast.ASTNode; -import org.eclipse.jdt.internal.compiler.ast.Annotation; -import org.eclipse.jdt.internal.compiler.ast.FieldDeclaration; -import org.eclipse.jdt.internal.core.CompilationUnit; -import org.eclipse.jdt.internal.core.SourceMethod; - -import lombok.core.FieldAugment; - -public final class EclipseAugments { - private EclipseAugments() { - // Prevent instantiation - } - - public static final FieldAugment FieldDeclaration_booleanLazyGetter = FieldAugment.augment(FieldDeclaration.class, boolean.class, "lombok$booleanLazyGetter"); - public static final FieldAugment ASTNode_handled = FieldAugment.augment(ASTNode.class, boolean.class, "lombok$handled"); - public static final FieldAugment ASTNode_generatedBy = FieldAugment.augment(ASTNode.class, ASTNode.class, "$generatedBy"); - public static final FieldAugment Annotation_applied = FieldAugment.augment(Annotation.class, boolean.class, "lombok$applied"); - public static final FieldAugment> CompilationUnit_javadoc = FieldAugment.augment(CompilationUnit.class, Map.class, "$javadoc"); - public static final FieldAugment>> CompilationUnit_delegateMethods = FieldAugment.augment(CompilationUnit.class, ConcurrentMap.class, "$delegateMethods"); -} diff --git a/src/core/lombok/eclipse/HandlerLibrary.java b/src/core/lombok/eclipse/HandlerLibrary.java index 0e72fb38..8d69325e 100644 --- a/src/core/lombok/eclipse/HandlerLibrary.java +++ b/src/core/lombok/eclipse/HandlerLibrary.java @@ -23,7 +23,7 @@ package lombok.eclipse; import static lombok.eclipse.Eclipse.*; import static lombok.eclipse.handlers.EclipseHandlerUtil.*; -import static lombok.eclipse.EclipseAugments.ASTNode_handled; +import static lombok.eclipse.EcjAugments.ASTNode_handled; import java.io.IOException; import java.lang.annotation.Annotation; diff --git a/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java b/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java index d85c2ee8..03f26341 100644 --- a/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java +++ b/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java @@ -23,7 +23,7 @@ package lombok.eclipse.handlers; import static lombok.core.handlers.HandlerUtil.*; import static lombok.eclipse.Eclipse.*; -import static lombok.eclipse.EclipseAugments.*; +import static lombok.eclipse.EcjAugments.*; import static lombok.eclipse.handlers.EclipseHandlerUtil.EclipseReflectiveMembers.*; import java.lang.reflect.Array; @@ -2649,22 +2649,42 @@ public class EclipseHandlerUtil { return null; } + private static class EclipseOnlyUtil { + public static void setDocComment(CompilationUnitDeclaration cud, TypeDeclaration type, ASTNode node, String doc) { + if (cud.compilationResult.compilationUnit instanceof CompilationUnit) { + CompilationUnit compilationUnit = (CompilationUnit) cud.compilationResult.compilationUnit; + Map docs = EclipseAugments.CompilationUnit_javadoc.setIfAbsent(compilationUnit, new HashMap()); + + if (node instanceof AbstractMethodDeclaration) { + AbstractMethodDeclaration methodDeclaration = (AbstractMethodDeclaration) node; + String signature = getSignature(type, methodDeclaration); + /* Add javadoc start marker, add leading asterisks to each line, add javadoc end marker */ + docs.put(signature, String.format("/**%n%s%n */", doc.replaceAll("(?m)^", " * "))); + } + } + } + } + + private static Boolean eclipseMode; + private static boolean eclipseMode() { + if (eclipseMode != null) return eclipseMode.booleanValue(); + try { + Class.forName("org.eclipse.jdt.internal.core.CompilationUnit"); + eclipseMode = true; + } catch (Exception e) { + eclipseMode = false; + } + return eclipseMode; + } + public static void setDocComment(CompilationUnitDeclaration cud, EclipseNode eclipseNode, String doc) { + if (!eclipseMode()) return; setDocComment(cud, (TypeDeclaration) upToTypeNode(eclipseNode).get(), eclipseNode.get(), doc); } - + public static void setDocComment(CompilationUnitDeclaration cud, TypeDeclaration type, ASTNode node, String doc) { - if (cud.compilationResult.compilationUnit instanceof CompilationUnit) { - CompilationUnit compilationUnit = (CompilationUnit) cud.compilationResult.compilationUnit; - Map docs = CompilationUnit_javadoc.setIfAbsent(compilationUnit, new HashMap()); - - if (node instanceof AbstractMethodDeclaration) { - AbstractMethodDeclaration methodDeclaration = (AbstractMethodDeclaration) node; - String signature = getSignature(type, methodDeclaration); - /* Add javadoc start marker, add leading asterisks to each line, add javadoc end marker */ - docs.put(signature, String.format("/**%n%s%n */", doc.replaceAll("(?m)^", " * "))); - } - } + if (!eclipseMode()) return; + EclipseOnlyUtil.setDocComment(cud, type, node, doc); } public static String getSignature(TypeDeclaration type, AbstractMethodDeclaration methodDeclaration) { diff --git a/src/core/lombok/javac/handlers/JavacHandlerUtil.java b/src/core/lombok/javac/handlers/JavacHandlerUtil.java index 2379d0a0..5ff29758 100644 --- a/src/core/lombok/javac/handlers/JavacHandlerUtil.java +++ b/src/core/lombok/javac/handlers/JavacHandlerUtil.java @@ -144,12 +144,12 @@ public class JavacHandlerUtil { Options options = Options.instance(context); return (options.keySet().contains("ide") && !options.keySet().contains("backgroundCompilation")); } - + public static boolean inNetbeansCompileOnSave(Context context) { Options options = Options.instance(context); return (options.keySet().contains("ide") && options.keySet().contains("backgroundCompilation")); } - + public static JCTree getGeneratedBy(JCTree node) { return JCTree_generatedNode.get(node); } @@ -1026,7 +1026,7 @@ public class JavacHandlerUtil { public static JavacNode injectField(JavacNode typeNode, JCVariableDecl field) { return injectField(typeNode, field, false); } - + public static JavacNode injectField(JavacNode typeNode, JCVariableDecl field, boolean addGenerated) { return injectField(typeNode, field, addGenerated, false); } @@ -1076,6 +1076,17 @@ public class JavacHandlerUtil { private static Constructor CONSTRUCTOR; private static Field ANNOTATIONS, UNDERLYING_TYPE; + private static void initByLoader(ClassLoader classLoader) { + if (TYPE != null) return; + Class c; + try { + c = classLoader.loadClass("com.sun.tools.javac.tree.JCTree$JCAnnotatedType"); + } catch (Exception e) { + return; + } + init(c); + } + private static void init(Class in) { if (TYPE != null) return; if (!in.getName().equals("com.sun.tools.javac.tree.JCTree$JCAnnotatedType")) return; @@ -1120,17 +1131,18 @@ public class JavacHandlerUtil { } static JCExpression create(List annotations, JCExpression underlyingType) { + initByLoader(underlyingType.getClass().getClassLoader()); try { return (JCExpression) CONSTRUCTOR.newInstance(annotations, underlyingType); } catch (Exception e) { - return null; + return underlyingType; } } } - + static class JCAnnotationReflect { private static Field ATTRIBUTE; - + static { try { ATTRIBUTE = Permit.getField(JCAnnotation.class, "attribute"); @@ -1199,7 +1211,7 @@ public class JavacHandlerUtil { Context context = typeNode.getContext(); Symtab symtab = Symtab.instance(context); JCClassDecl type = (JCClassDecl) typeNode.get(); - + if (method.getName().contentEquals("")) { //Scan for default constructor, and remove it. int idx = 0; @@ -1216,11 +1228,11 @@ public class JavacHandlerUtil { idx++; } } - + addSuppressWarningsAll(method.mods, typeNode, method.pos, getGeneratedBy(method), typeNode.getContext()); addGenerated(method.mods, typeNode, method.pos, getGeneratedBy(method), typeNode.getContext()); type.defs = type.defs.append(method); - + List params = null; if (method.getParameters() != null && !method.getParameters().isEmpty()) { ListBuffer newParams = new ListBuffer(); @@ -1250,12 +1262,12 @@ public class JavacHandlerUtil { params = newParams.toList(); if (params.length() != method.getParameters().length()) params = null; } - + fixMethodMirror(typeNode.getContext(), typeNode.getElement(), method.getModifiers().flags, method.getName(), paramTypes, params, returnType); - + typeNode.add(method, Kind.METHOD); } - + private static void fixMethodMirror(Context context, Element typeMirror, long access, Name methodName, List paramTypes, List params, Type returnType) { if (typeMirror == null || paramTypes == null || returnType == null) return; ClassSymbol cs = (ClassSymbol) typeMirror; @@ -1428,6 +1440,7 @@ public class JavacHandlerUtil { } return e; } + /** * In javac, dotted access of any kind, from {@code java.lang.String} to {@code var.methodName} * is represented by a fold-left of {@code Select} nodes with the leftmost string represented by @@ -1831,20 +1844,30 @@ public class JavacHandlerUtil { public static JCExpression namePlusTypeParamsToTypeReference(JavacTreeMaker maker, JavacNode type, List params) { JCClassDecl td = (JCClassDecl) type.get(); boolean instance = (td.mods.flags & Flags.STATIC) == 0; - return namePlusTypeParamsToTypeReference(maker, type.up(), td.name, instance, params); + return namePlusTypeParamsToTypeReference(maker, type.up(), td.name, instance, params, List.nil()); + } + + public static JCExpression namePlusTypeParamsToTypeReference(JavacTreeMaker maker, JavacNode type, List params, List annotations) { + JCClassDecl td = (JCClassDecl) type.get(); + boolean instance = (td.mods.flags & Flags.STATIC) == 0; + return namePlusTypeParamsToTypeReference(maker, type.up(), td.name, instance, params, annotations); } public static JCExpression namePlusTypeParamsToTypeReference(JavacTreeMaker maker, JavacNode parentType, Name typeName, boolean instance, List params) { + return namePlusTypeParamsToTypeReference(maker, parentType, typeName, instance, params, List.nil()); + } + + public static JCExpression namePlusTypeParamsToTypeReference(JavacTreeMaker maker, JavacNode parentType, Name typeName, boolean instance, List params, List annotations) { JCExpression r = null; - if (parentType != null && parentType.getKind() == Kind.TYPE) { JCClassDecl td = (JCClassDecl) parentType.get(); boolean outerInstance = instance && ((td.mods.flags & Flags.STATIC) == 0); List outerParams = instance ? td.typarams : List.nil(); - r = namePlusTypeParamsToTypeReference(maker, parentType.up(), td.name, outerInstance, outerParams); + r = namePlusTypeParamsToTypeReference(maker, parentType.up(), td.name, outerInstance, outerParams, List.nil()); } r = r == null ? maker.Ident(typeName) : maker.Select(r, typeName); + if (!annotations.isEmpty()) r = JCAnnotatedTypeReflect.create(annotations, r); if (!params.isEmpty()) r = maker.TypeApply(r, typeParameterNames(maker, params)); return r; } @@ -2078,6 +2101,7 @@ public class JavacHandlerUtil { public static void copyJavadoc(JavacNode from, JCTree to, CopyJavadoc copyMode) { copyJavadoc(from, to, copyMode, false); } + /** * Copies javadoc on one node to the other. * diff --git a/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java b/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java index 3412000e..75263bdd 100644 --- a/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java +++ b/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java @@ -50,8 +50,7 @@ import lombok.patcher.scripts.ScriptBuilder; */ public class EclipsePatcher implements AgentLauncher.AgentLaunchable { // At some point I'd like the agent to be capable of auto-detecting if its on eclipse or on ecj. This class is a sure sign we're not in ecj but in eclipse. -ReinierZ - @SuppressWarnings("unused") - private static final String ECLIPSE_SIGNATURE_CLASS = "org/eclipse/core/runtime/adaptor/EclipseStarter"; + private static final String ECLIPSE_SIGNATURE_CLASS = "org.eclipse.core.runtime.adaptor.EclipseStarter"; @Override public void runAgent(String agentArgs, Instrumentation instrumentation, boolean injected, Class launchingContext) throws Exception { String[] args = agentArgs == null ? new String[0] : agentArgs.split(":"); @@ -73,6 +72,12 @@ public class EclipsePatcher implements AgentLauncher.AgentLaunchable { else if (forceEclipse) ecj = false; else ecj = injected; + if (!ecj) try { + Class.forName(ECLIPSE_SIGNATURE_CLASS); + } catch (ClassNotFoundException e) { + ecj = true; + } + registerPatchScripts(instrumentation, injected, ecj, launchingContext); } @@ -117,6 +122,7 @@ public class EclipsePatcher implements AgentLauncher.AgentLaunchable { patchExtractInterface(sm); patchAboutDialog(sm); patchEclipseDebugPatches(sm); + patchJavadoc(sm); } else { patchPostCompileHookEcj(sm); } @@ -127,7 +133,6 @@ public class EclipsePatcher implements AgentLauncher.AgentLaunchable { patchExtensionMethod(sm, ecjOnly); patchRenameField(sm); patchNullCheck(sm); - patchJavadoc(sm); if (reloadExistingClasses) sm.reloadClasses(instrumentation); } diff --git a/src/eclipseAgent/lombok/eclipse/agent/PatchDelegate.java b/src/eclipseAgent/lombok/eclipse/agent/PatchDelegate.java index e92ed674..b90d5762 100644 --- a/src/eclipseAgent/lombok/eclipse/agent/PatchDelegate.java +++ b/src/eclipseAgent/lombok/eclipse/agent/PatchDelegate.java @@ -22,7 +22,7 @@ package lombok.eclipse.agent; import static lombok.eclipse.Eclipse.*; -import static lombok.eclipse.EclipseAugments.*; +import static lombok.eclipse.EcjAugments.*; import static lombok.eclipse.handlers.EclipseHandlerUtil.*; import java.lang.reflect.Method; @@ -724,7 +724,7 @@ public class PatchDelegate { private static void cleanupDelegateMethods(CompilationUnitDeclaration cud) { CompilationUnit compilationUnit = getCompilationUnit(cud); if (compilationUnit != null) { - CompilationUnit_delegateMethods.clear(compilationUnit); + EclipseAugments.CompilationUnit_delegateMethods.clear(compilationUnit); } } @@ -819,7 +819,7 @@ public class PatchDelegate { if (sourceType != null) { CompilationUnit compilationUnit = getCompilationUnit(sourceType.getCompilationUnit()); if (compilationUnit != null) { - ConcurrentMap> map = CompilationUnit_delegateMethods.setIfAbsent(compilationUnit, new ConcurrentHashMap>()); + ConcurrentMap> map = EclipseAugments.CompilationUnit_delegateMethods.setIfAbsent(compilationUnit, new ConcurrentHashMap>()); List newList = new ArrayList(); List oldList = map.putIfAbsent(sourceType.getTypeQualifiedName(), newList); return oldList != null ? oldList : newList; diff --git a/src/eclipseAgent/lombok/eclipse/agent/PatchJavadoc.java b/src/eclipseAgent/lombok/eclipse/agent/PatchJavadoc.java index a91e4d8b..19a0383a 100644 --- a/src/eclipseAgent/lombok/eclipse/agent/PatchJavadoc.java +++ b/src/eclipseAgent/lombok/eclipse/agent/PatchJavadoc.java @@ -21,7 +21,7 @@ */ package lombok.eclipse.agent; -import static lombok.eclipse.EclipseAugments.CompilationUnit_javadoc; +import static lombok.eclipse.EcjAugments.EclipseAugments.CompilationUnit_javadoc; import java.lang.reflect.Method; import java.util.Map; @@ -36,7 +36,6 @@ import org.eclipse.jdt.internal.core.CompilationUnit; import org.eclipse.jdt.internal.core.SourceMethod; import org.eclipse.jdt.internal.ui.text.javadoc.JavadocContentAccess2; -import lombok.eclipse.EclipseAugments; import lombok.eclipse.handlers.EclipseHandlerUtil; import lombok.permit.Permit; @@ -52,7 +51,7 @@ public class PatchJavadoc { ICompilationUnit iCompilationUnit = sourceMethod.getCompilationUnit(); if (iCompilationUnit instanceof CompilationUnit) { CompilationUnit compilationUnit = (CompilationUnit) iCompilationUnit; - Map docs = EclipseAugments.CompilationUnit_javadoc.get(compilationUnit); + Map docs = CompilationUnit_javadoc.get(compilationUnit); String signature = getSignature(sourceMethod); String rawJavadoc = docs.get(signature); @@ -80,7 +79,7 @@ public class PatchJavadoc { } return methodDeclaration.print(tab, output); } - + private static String getSignature(SourceMethod sourceMethod) { StringBuilder sb = new StringBuilder(); sb.append(sourceMethod.getParent().getElementName()); diff --git a/src/eclipseAgent/lombok/launch/PatchFixesHider.java b/src/eclipseAgent/lombok/launch/PatchFixesHider.java index a2cda66c..55e8e0bf 100755 --- a/src/eclipseAgent/lombok/launch/PatchFixesHider.java +++ b/src/eclipseAgent/lombok/launch/PatchFixesHider.java @@ -66,7 +66,7 @@ import org.eclipse.jdt.internal.core.dom.rewrite.TokenScanner; import org.eclipse.jdt.internal.corext.refactoring.SearchResultGroup; import org.eclipse.jdt.internal.corext.refactoring.structure.ASTNodeSearchUtil; -import lombok.eclipse.EclipseAugments; +import static lombok.eclipse.EcjAugments.ASTNode_generatedBy; /** These contain a mix of the following: *
    @@ -545,14 +545,14 @@ final class PatchFixesHider { public static int fixRetrieveRightBraceOrSemiColonPosition(int retVal, AbstractMethodDeclaration amd) { if (retVal != -1 || amd == null) return retVal; - boolean isGenerated = EclipseAugments.ASTNode_generatedBy.get(amd) != null; + boolean isGenerated = ASTNode_generatedBy.get(amd) != null; if (isGenerated) return amd.declarationSourceEnd; return -1; } public static int fixRetrieveRightBraceOrSemiColonPosition(int retVal, FieldDeclaration fd) { if (retVal != -1 || fd == null) return retVal; - boolean isGenerated = EclipseAugments.ASTNode_generatedBy.get(fd) != null; + boolean isGenerated = ASTNode_generatedBy.get(fd) != null; if (isGenerated) return fd.declarationSourceEnd; return -1; } @@ -578,13 +578,13 @@ final class PatchFixesHider { org.eclipse.jdt.internal.compiler.ast.ASTNode internalNode) throws Exception { if (internalNode == null || domNode == null) return; - boolean isGenerated = EclipseAugments.ASTNode_generatedBy.get(internalNode) != null; + boolean isGenerated = ASTNode_generatedBy.get(internalNode) != null; if (isGenerated) domNode.getClass().getField("$isGenerated").set(domNode, true); } public static void setIsGeneratedFlagForName(org.eclipse.jdt.core.dom.Name name, Object internalNode) throws Exception { if (internalNode instanceof org.eclipse.jdt.internal.compiler.ast.ASTNode) { - boolean isGenerated = EclipseAugments.ASTNode_generatedBy.get((org.eclipse.jdt.internal.compiler.ast.ASTNode) internalNode) != null; + boolean isGenerated = ASTNode_generatedBy.get((org.eclipse.jdt.internal.compiler.ast.ASTNode) internalNode) != null; if (isGenerated) name.getClass().getField("$isGenerated").set(name, true); } } -- cgit