aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@tipit.to>2009-12-01 00:24:42 +0100
committerReinier Zwitserloot <reinier@tipit.to>2009-12-01 00:24:42 +0100
commit92e2afe9b0dccc7d0055b52d07ab3128c2adf4de (patch)
treef99500d99c22ee891649f9a90d3e58563fdaec3f
parent9fb4c3a42429c102e4cb9235b7e70163b2d5ed86 (diff)
downloadlombok-92e2afe9b0dccc7d0055b52d07ab3128c2adf4de.tar.gz
lombok-92e2afe9b0dccc7d0055b52d07ab3128c2adf4de.tar.bz2
lombok-92e2afe9b0dccc7d0055b52d07ab3128c2adf4de.zip
Fixes
-rw-r--r--src/netbeansAgent/lombok/netbeans/agent/NetbeansPatcher.java8
-rw-r--r--src/netbeansAgent/lombok/netbeans/agent/PatchFixes.java23
2 files changed, 14 insertions, 17 deletions
diff --git a/src/netbeansAgent/lombok/netbeans/agent/NetbeansPatcher.java b/src/netbeansAgent/lombok/netbeans/agent/NetbeansPatcher.java
index 108b4c45..2a87ad6c 100644
--- a/src/netbeansAgent/lombok/netbeans/agent/NetbeansPatcher.java
+++ b/src/netbeansAgent/lombok/netbeans/agent/NetbeansPatcher.java
@@ -67,8 +67,8 @@ public class NetbeansPatcher {
.transplant()
.target(new MethodTarget("org.netbeans.modules.java.source.parsing.JavacParser", "createJavacTask",
"com.sun.tools.javac.api.JavacTaskImpl",
- "ClasspathInfo", "DiagnosticListener", "java.lang.String", "boolean",
- "ClassNamesForFileOraculum", "CancelService"))
+ "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"))
.build());
@@ -83,7 +83,7 @@ public class NetbeansPatcher {
.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;"))
- .requestExtra(StackRequest.PARAM1)
+ .requestExtra(StackRequest.PARAM1).transplant()
.build());
sm.addScript(ScriptBuilder.replaceMethodCall()
@@ -93,7 +93,7 @@ public class NetbeansPatcher {
"(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"))
- .build());
+ .transplant().build());
sm.addScript(ScriptBuilder.wrapMethodCall()
.target(new MethodTarget("org.netbeans.modules.java.source.save.CasualDiff", "filterHidden"))
diff --git a/src/netbeansAgent/lombok/netbeans/agent/PatchFixes.java b/src/netbeansAgent/lombok/netbeans/agent/PatchFixes.java
index cd5ef965..4aa7f77c 100644
--- a/src/netbeansAgent/lombok/netbeans/agent/PatchFixes.java
+++ b/src/netbeansAgent/lombok/netbeans/agent/PatchFixes.java
@@ -48,22 +48,19 @@ public class PatchFixes {
if (context.get(TaskListener.class) != null)
context.put(TaskListener.class, (TaskListener)null);
if (taskListener != null) {
- try {
- Method m = JavacTaskImpl.class.getDeclaredMethod("wrap", TaskListener.class);
- try {
- m.setAccessible(true);
- } catch (SecurityException ignore) {}
- TaskListener w = (TaskListener)m.invoke(that, taskListener);
- context.put(TaskListener.class, w);
- } catch (InvocationTargetException e) {
- throw e.getCause();
- }
+// try {
+// Method m = JavacTaskImpl.class.getDeclaredMethod("wrap", TaskListener.class);
+// try {
+// m.setAccessible(true);
+// } catch (SecurityException ignore) {}
+// TaskListener w = (TaskListener)m.invoke(that, taskListener);
+ context.put(TaskListener.class, taskListener);
+// } catch (InvocationTargetException e) {
+// throw e.getCause();
+// }
}
}
- //Contributed by Jan Lahoda (jlahoda@netbeans.org)
- //Turned into a patch script by rzwitserloot.
- //see http://code.google.com/p/projectlombok/issues/detail?id=20#c3
public static Tree returnNullForGeneratedNode(Trees trees, Element element, Object o) throws Throwable {
try {
Tree tree = trees.getTree(element);