aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java60
-rw-r--r--src/netbeansAgent/lombok/netbeans/agent/NetbeansPatcher.java45
2 files changed, 50 insertions, 55 deletions
diff --git a/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java b/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java
index ce494daa..7dc17320 100644
--- a/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java
+++ b/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java
@@ -72,8 +72,8 @@ public class EclipsePatcher extends Agent {
sm.addScript(ScriptBuilder.wrapReturnValue()
.target(new MethodTarget("org.eclipse.jdt.internal.corext.dom.LinkedNodeFinder", "findByNode"))
.target(new MethodTarget("org.eclipse.jdt.internal.corext.dom.LinkedNodeFinder", "findByBinding"))
- .wrapMethod(new Hook("lombok/eclipse/agent/PatchFixes", "removeGeneratedSimpleNames",
- "([Lorg/eclipse/jdt/core/dom/SimpleName;)[Lorg/eclipse/jdt/core/dom/SimpleName;"))
+ .wrapMethod(new Hook("lombok.eclipse.agent.PatchFixes", "removeGeneratedSimpleNames", "org.eclipse.jdt.core.dom.SimpleName",
+ "org.eclipse.jdt.core.dom.SimpleName"))
.request(StackRequest.RETURN_VALUE).build());
patchRefactorScripts(sm);
@@ -83,8 +83,8 @@ public class EclipsePatcher extends Agent {
private static void patchFormatters(ScriptManager sm) {
sm.addScript(ScriptBuilder.setSymbolDuringMethodCall()
.target(new MethodTarget("org.eclipse.jdt.internal.ui.text.java.JavaFormattingStrategy", "format", "void"))
- .callToWrap(new Hook("org/eclipse/jdt/internal/corext/util/CodeFormatterUtil", "reformat",
- "(ILjava/lang/String;IIILjava/lang/String;Ljava/util/Map;)Lorg/eclipse/text/edits/TextEdit;"))
+ .callToWrap(new Hook("org.eclipse.jdt.internal.corext.util.CodeFormatterUtil", "reformat", "org.eclipse.text.edits.TextEdit",
+ "int", "java.lang.String", "int", "int", "int", "java.lang.String", "java.util.Map"))
.symbol("lombok.disable").build());
}
@@ -92,22 +92,22 @@ public class EclipsePatcher extends Agent {
sm.addScript(ScriptBuilder.exitEarly()
.target(new MethodTarget("org.eclipse.jdt.core.dom.rewrite.ASTRewrite", "replace"))
.target(new MethodTarget("org.eclipse.jdt.core.dom.rewrite.ASTRewrite", "remove"))
- .decisionMethod(new Hook("lombok/eclipse/agent/PatchFixes", "skipRewritingGeneratedNodes",
- "(Lorg/eclipse/jdt/core/dom/ASTNode;)Z"))
+ .decisionMethod(new Hook("lombok.eclipse.agent.PatchFixes", "skipRewritingGeneratedNodes", "boolean",
+ "org.eclipse.jdt.core.dom.ASTNode"))
.transplant().request(StackRequest.PARAM1).build());
sm.addScript(ScriptBuilder.wrapMethodCall()
.target(new MethodTarget("org.eclipse.jdt.internal.corext.refactoring.rename.RenameTypeProcessor", "addConstructorRenames"))
- .methodToWrap(new Hook("org/eclipse/jdt/core/IType", "getMethods", "()[Lorg/eclipse/jdt/core/IMethod;"))
- .wrapMethod(new Hook("lombok/eclipse/agent/PatchFixes", "removeGeneratedMethods",
- "([Lorg/eclipse/jdt/core/IMethod;)[Lorg/eclipse/jdt/core/IMethod;"))
+ .methodToWrap(new Hook("org.eclipse.jdt.core.IType", "getMethods", "org.eclipse.jdt.core.IMethod[]"))
+ .wrapMethod(new Hook("lombok.eclipse.agent.PatchFixes", "removeGeneratedMethods", "org.eclipse.jdt.core.IMethod[]",
+ "org.eclipse.jdt.core.IMethod[]"))
.transplant().build());
}
private static void patchCatchReparse(ScriptManager sm) {
sm.addScript(ScriptBuilder.wrapReturnValue()
.target(new MethodTarget("org.eclipse.jdt.core.dom.ASTConverter", "retrieveStartingCatchPosition"))
- .wrapMethod(new Hook("lombok/eclipse/agent/PatchFixes", "fixRetrieveStartingCatchPosition", "(I)I"))
+ .wrapMethod(new Hook("lombok.eclipse.agent.PatchFixes", "fixRetrieveStartingCatchPosition", "int", "int"))
.transplant().request(StackRequest.PARAM1).build());
}
@@ -139,8 +139,8 @@ public class EclipsePatcher extends Agent {
return Collections.singleton("org.eclipse.jdt.core.dom.ASTConverter");
}
}).request(StackRequest.PARAM1, StackRequest.RETURN_VALUE)
- .wrapMethod(new Hook("lombok/eclipse/agent/PatchFixes", "setIsGeneratedFlag",
- "(Lorg/eclipse/jdt/core/dom/ASTNode;Lorg/eclipse/jdt/internal/compiler/ast/ASTNode;)V"))
+ .wrapMethod(new Hook("lombok.eclipse.agent.PatchFixes", "setIsGeneratedFlag", "void",
+ "org.eclipse.jdt.core.dom.ASTNode", "org.eclipse.jdt.internal.compiler.ast.ASTNode"))
.transplant().build());
sm.addScript(ScriptBuilder.wrapMethodCall()
@@ -158,35 +158,35 @@ public class EclipsePatcher extends Agent {
@Override public Collection<String> getAffectedClasses() {
return Collections.singleton("org.eclipse.jdt.core.dom.ASTConverter");
}
- }).methodToWrap(new Hook("org/eclipse/jdt/core/dom/SimpleName", "<init>", "(Lorg/eclipse/jdt/core/dom/AST;)V"))
+ }).methodToWrap(new Hook("org.eclipse.jdt.core.dom.SimpleName", "<init>", "void", "org.eclipse.jdt.core.dom.AST"))
.requestExtra(StackRequest.PARAM1)
- .wrapMethod(new Hook("lombok/eclipse/agent/PatchFixes", "setIsGeneratedFlagForSimpleName",
- "(Lorg/eclipse/jdt/core/dom/SimpleName;Ljava/lang/Object;)V"))
+ .wrapMethod(new Hook("lombok.eclipse.agent.PatchFixes", "setIsGeneratedFlagForSimpleName", "void",
+ "org.eclipse.jdt.core.dom.SimpleName", "java.lang.Object"))
.transplant().build());
}
private static void patchAvoidReparsingGeneratedCode(ScriptManager sm) {
- final String PARSER_SIG1 = "org.eclipse.jdt.internal.compiler.parser.Parser";
+ final String PARSER_SIG = "org.eclipse.jdt.internal.compiler.parser.Parser";
sm.addScript(ScriptBuilder.exitEarly()
- .target(new MethodTarget(PARSER_SIG1, "parse", "void",
+ .target(new MethodTarget(PARSER_SIG, "parse", "void",
"org.eclipse.jdt.internal.compiler.ast.MethodDeclaration",
"org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration"))
- .decisionMethod(new Hook("lombok/eclipse/agent/PatchFixes", "checkBit24", "(Ljava/lang/Object;)Z"))
+ .decisionMethod(new Hook("lombok.eclipse.agent.PatchFixes", "checkBit24", "boolean", "java.lang.Object"))
.request(StackRequest.PARAM1).build());
sm.addScript(ScriptBuilder.exitEarly()
- .target(new MethodTarget(PARSER_SIG1, "parse", "void",
+ .target(new MethodTarget(PARSER_SIG, "parse", "void",
"org.eclipse.jdt.internal.compiler.ast.ConstructorDeclaration",
"org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration", "boolean"))
- .decisionMethod(new Hook("lombok/eclipse/agent/PatchFixes", "checkBit24", "(Ljava/lang/Object;)Z"))
+ .decisionMethod(new Hook("lombok.eclipse.agent.PatchFixes", "checkBit24", "boolean", "java.lang.Object"))
.request(StackRequest.PARAM1).build());
sm.addScript(ScriptBuilder.exitEarly()
- .target(new MethodTarget(PARSER_SIG1, "parse", "void",
+ .target(new MethodTarget(PARSER_SIG, "parse", "void",
"org.eclipse.jdt.internal.compiler.ast.Initializer",
"org.eclipse.jdt.internal.compiler.ast.TypeDeclaration",
"org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration"))
- .decisionMethod(new Hook("lombok/eclipse/agent/PatchFixes", "checkBit24", "(Ljava/lang/Object;)Z"))
+ .decisionMethod(new Hook("lombok.eclipse.agent.PatchFixes", "checkBit24", "boolean", "java.lang.Object"))
.request(StackRequest.PARAM1).build());
}
@@ -196,21 +196,17 @@ public class EclipsePatcher extends Agent {
.fieldName("$lombokAST").fieldType("Ljava/lang/Object;")
.setPublic().setTransient().build());
- final String PARSER_SIG1 = "org.eclipse.jdt.internal.compiler.parser.Parser";
- final String PARSER_SIG2 = "Lorg/eclipse/jdt/internal/compiler/parser/Parser;";
- final String CUD_SIG1 = "org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration";
- final String CUD_SIG2 = "Lorg/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration;";
+ final String PARSER_SIG = "org.eclipse.jdt.internal.compiler.parser.Parser";
+ final String CUD_SIG = "org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration";
sm.addScript(ScriptBuilder.wrapReturnValue()
- .target(new MethodTarget(PARSER_SIG1, "getMethodBodies", "void", CUD_SIG1))
- .wrapMethod(new Hook("lombok/eclipse/TransformEclipseAST", "transform",
- "(" + PARSER_SIG2 + CUD_SIG2 + ")V"))
+ .target(new MethodTarget(PARSER_SIG, "getMethodBodies", "void", CUD_SIG))
+ .wrapMethod(new Hook("lombok.eclipse.TransformEclipseAST", "transform", "void", PARSER_SIG, CUD_SIG))
.request(StackRequest.THIS, StackRequest.PARAM1).build());
sm.addScript(ScriptBuilder.wrapReturnValue()
- .target(new MethodTarget(PARSER_SIG1, "endParse", CUD_SIG1, "int"))
- .wrapMethod(new Hook("lombok/eclipse/TransformEclipseAST", "transform_swapped",
- "(" + CUD_SIG2 + PARSER_SIG2 + ")V"))
+ .target(new MethodTarget(PARSER_SIG, "endParse", CUD_SIG, "int"))
+ .wrapMethod(new Hook("lombok.eclipse.TransformEclipseAST", "transform_swapped", "void", CUD_SIG, PARSER_SIG))
.request(StackRequest.THIS, StackRequest.RETURN_VALUE).build());
}
}
diff --git a/src/netbeansAgent/lombok/netbeans/agent/NetbeansPatcher.java b/src/netbeansAgent/lombok/netbeans/agent/NetbeansPatcher.java
index e6ae5c03..ffe491ae 100644
--- a/src/netbeansAgent/lombok/netbeans/agent/NetbeansPatcher.java
+++ b/src/netbeansAgent/lombok/netbeans/agent/NetbeansPatcher.java
@@ -58,28 +58,28 @@ public class NetbeansPatcher extends Agent {
sm.addScript(ScriptBuilder.exitEarly()
.transplant().request(StackRequest.PARAM1, StackRequest.PARAM2)
.target(new MethodTarget("org.netbeans.StandardModule$OneModuleClassLoader", "<init>"))
- .decisionMethod(new Hook("lombok/netbeans/agent/PatchFixes", "addSelfToClassLoader", "(Lorg/netbeans/Module;Ljava/util/List;)V"))
+ .decisionMethod(new Hook("lombok.netbeans.agent.PatchFixes", "addSelfToClassLoader", "void", "org.netbeans.Module", "java.util.List"))
.build());
sm.addScript(ScriptBuilder.exitEarly()
.transplant()
.request(StackRequest.THIS, StackRequest.PARAM1)
.target(new MethodTarget("org.netbeans.ProxyClassLoader", "getResource"))
- .decisionMethod(new Hook("lombok/netbeans/agent/PatchFixes", "getResource_decision", "(Ljava/lang/ClassLoader;Ljava/lang/String;)Z"))
- .valueMethod(new Hook("lombok/netbeans/agent/PatchFixes", "getResource_value", "(Ljava/lang/ClassLoader;Ljava/lang/String;)Ljava/net/URL;"))
+ .decisionMethod(new Hook("lombok.netbeans.agent.PatchFixes", "getResource_decision", "boolean", "java.lang.ClassLoader", "java.lang.String"))
+ .valueMethod(new Hook("lombok.netbeans.agent.PatchFixes", "getResource_value", "java.net.URL", "java.lang.ClassLoader", "java.lang.String"))
.build());
sm.addScript(ScriptBuilder.exitEarly()
.transplant()
.request(StackRequest.THIS, StackRequest.PARAM1)
.target(new MethodTarget("org.netbeans.ProxyClassLoader", "getResources"))
- .decisionMethod(new Hook("lombok/netbeans/agent/PatchFixes", "getResources_decision", "(Ljava/lang/ClassLoader;Ljava/lang/String;)Z"))
- .valueMethod(new Hook("lombok/netbeans/agent/PatchFixes", "getResources_value", "(Ljava/lang/ClassLoader;Ljava/lang/String;)Ljava/util/Enumeration;"))
+ .decisionMethod(new Hook("lombok.netbeans.agent.PatchFixes", "getResources_decision", "boolean", "java.lang.ClassLoader", "java.lang.String"))
+ .valueMethod(new Hook("lombok.netbeans.agent.PatchFixes", "getResources_value", "java.util.Enumeration", "java.lang.ClassLoader", "java.lang.String"))
.build());
sm.addScript(ScriptBuilder.exitEarly()
.transplant()
.target(new MethodTarget("org.netbeans.ProxyClassLoader", "loadClass"))
.request(StackRequest.THIS, StackRequest.PARAM1)
- .decisionMethod(new Hook("lombok/netbeans/agent/PatchFixes", "loadClass_decision", "(Ljava/lang/ClassLoader;Ljava/lang/String;)Z"))
- .valueMethod(new Hook("lombok/netbeans/agent/PatchFixes", "loadClass_value", "(Ljava/lang/ClassLoader;Ljava/lang/String;)Ljava/lang/Class;"))
+ .decisionMethod(new Hook("lombok.netbeans.agent.PatchFixes", "loadClass_decision", "boolean", "java.lang.ClassLoader", "java.lang.String"))
+ .valueMethod(new Hook("lombok.netbeans.agent.PatchFixes", "loadClass_value", "java.lang.Class", "java.lang.ClassLoader", "java.lang.String"))
.build());
}
@@ -88,8 +88,8 @@ public class NetbeansPatcher extends Agent {
.request(StackRequest.THIS, StackRequest.PARAM1)
.transplant()
.target(new MethodTarget("com.sun.tools.javac.api.JavacTaskImpl", "setTaskListener"))
- .wrapMethod(new Hook("lombok/netbeans/agent/PatchFixes", "fixContentOnSetTaskListener",
- "(Lcom/sun/tools/javac/api/JavacTaskImpl;Lcom/sun/source/util/TaskListener;)V"))
+ .wrapMethod(new Hook("lombok.netbeans.agent.PatchFixes", "fixContentOnSetTaskListener", "void",
+ "com.sun.tools.javac.api.JavacTaskImpl", "com.sun.source.util.TaskListener"))
.build());
sm.addScript(ScriptBuilder.wrapReturnValue()
@@ -99,8 +99,8 @@ public class NetbeansPatcher extends Agent {
"com.sun.tools.javac.api.JavacTaskImpl",
"org.netbeans.api.java.source.ClasspathInfo", "javax.tools.DiagnosticListener", "java.lang.String", "boolean",
"com.sun.tools.javac.api.ClassNamesForFileOraculum", "com.sun.tools.javac.util.CancelService"))
- .wrapMethod(new Hook("lombok/netbeans/agent/PatchFixes", "addTaskListenerWhenCallingJavac",
- "(Lcom/sun/tools/javac/api/JavacTaskImpl;Lorg/netbeans/api/java/source/ClasspathInfo;)V"))
+ .wrapMethod(new Hook("lombok.netbeans.agent.PatchFixes", "addTaskListenerWhenCallingJavac", "void",
+ "com.sun.tools.javac.api.JavacTaskImpl", "org.netbeans.api.java.source.ClasspathInfo"))
.build());
}
@@ -108,28 +108,27 @@ public class NetbeansPatcher extends Agent {
sm.addScript(ScriptBuilder.replaceMethodCall()
.target(new MethodTarget("org.netbeans.modules.java.editor.overridden.ComputeAnnotations",
"createAnnotations"))
- .methodToReplace(new Hook("com/sun/source/util/Trees", "getTree",
- "(Ljavax/lang/model/element/Element;)Lcom/sun/source/tree/Tree;"))
- .replacementMethod(new Hook("lombok/netbeans/agent/PatchFixes", "returnNullForGeneratedNode",
- "(Lcom/sun/source/util/Trees;Ljavax/lang/model/element/Element;Ljava/lang/Object;)" +
- "Lcom/sun/source/tree/Tree;"))
+ .methodToReplace(new Hook("com.sun.source.util.Trees", "getTree", "com.sun.source.tree.Tree",
+ "javax.lang.model.element.Element"))
+ .replacementMethod(new Hook("lombok.netbeans.agent.PatchFixes", "returnNullForGeneratedNode", "com.sun.source.tree.Tree",
+ "com.sun.source.util.Trees", "javax.lang.model.element.Element", "java.lang.Object"))
.requestExtra(StackRequest.PARAM1).transplant()
.build());
sm.addScript(ScriptBuilder.replaceMethodCall()
.target(new MethodTarget("org.netbeans.modules.java.source.parsing.FindMethodRegionsVisitor",
"visitMethod"))
- .methodToReplace(new Hook("com/sun/source/util/SourcePositions", "getEndPosition",
- "(Lcom/sun/source/tree/CompilationUnitTree;Lcom/sun/source/tree/Tree;)J"))
- .replacementMethod(new Hook("lombok/netbeans/agent/PatchFixes", "returnMinus1ForGeneratedNode",
- "(Lcom/sun/source/util/SourcePositions;Lcom/sun/source/tree/CompilationUnitTree;Lcom/sun/source/tree/Tree;)J"))
+ .methodToReplace(new Hook("com.sun.source.util.SourcePositions", "getEndPosition", "long",
+ "com.sun.source.tree.CompilationUnitTree", "com.sun.source.tree.Tree"))
+ .replacementMethod(new Hook("lombok.netbeans.agent.PatchFixes", "returnMinus1ForGeneratedNode", "long",
+ "com.sun.source.util.SourcePositions", "com.sun.source.tree.CompilationUnitTree", "com.sun.source.tree.Tree"))
.transplant().build());
sm.addScript(ScriptBuilder.wrapMethodCall()
.target(new MethodTarget("org.netbeans.modules.java.source.save.CasualDiff", "filterHidden"))
- .methodToWrap(new Hook("java/lang/Iterable", "iterator", "()L/java/util/Iterator;"))
- .wrapMethod(new Hook("lombok/netbeans/agent/PatchFixes", "filterGenerated",
- "(Ljava/util/Iterator;)L/java/util/Iterator;"))
+ .methodToWrap(new Hook("java.lang.Iterable", "iterator", "java.util.Iterator"))
+ .wrapMethod(new Hook("lombok.netbeans.agent.PatchFixes", "filterGenerated", "java.util.Iterator",
+ "java.util.Iterator"))
.transplant().build());
}
}