aboutsummaryrefslogtreecommitdiff
path: root/src/eclipseAgent/lombok/launch
diff options
context:
space:
mode:
authorReinier Zwitserloot <r.zwitserloot@projectlombok.org>2020-09-18 02:27:35 +0200
committerReinier Zwitserloot <r.zwitserloot@projectlombok.org>2020-09-18 02:27:35 +0200
commit730670f1f4f41f41f23da6df59c06c40f717139a (patch)
tree392aeac4ec636bbceda0e8c9647d0c05e6c4014a /src/eclipseAgent/lombok/launch
parentea1578a0a9826473e004901f8e2a88ba4e65ea4c (diff)
parent23b80658bcf3ca0007a86d04ce6cc5f6c8db5ad4 (diff)
downloadlombok-730670f1f4f41f41f23da6df59c06c40f717139a.tar.gz
lombok-730670f1f4f41f41f23da6df59c06c40f717139a.tar.bz2
lombok-730670f1f4f41f41f23da6df59c06c40f717139a.zip
Merge branch 'eclipse-javadoc' of git://github.com/Rawi01/lombok into Rawi01-eclipse-javadoc
# Conflicts: # src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java
Diffstat (limited to 'src/eclipseAgent/lombok/launch')
-rwxr-xr-xsrc/eclipseAgent/lombok/launch/PatchFixesHider.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/eclipseAgent/lombok/launch/PatchFixesHider.java b/src/eclipseAgent/lombok/launch/PatchFixesHider.java
index 55807b9c..89e2a2cc 100755
--- a/src/eclipseAgent/lombok/launch/PatchFixesHider.java
+++ b/src/eclipseAgent/lombok/launch/PatchFixesHider.java
@@ -35,6 +35,7 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.IAnnotatable;
import org.eclipse.jdt.core.IAnnotation;
import org.eclipse.jdt.core.IField;
+import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
@@ -50,6 +51,7 @@ import org.eclipse.jdt.internal.compiler.ast.FieldDeclaration;
import org.eclipse.jdt.internal.compiler.ast.ForeachStatement;
import org.eclipse.jdt.internal.compiler.ast.LocalDeclaration;
import org.eclipse.jdt.internal.compiler.ast.MessageSend;
+import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
import org.eclipse.jdt.internal.compiler.lookup.BlockScope;
import org.eclipse.jdt.internal.compiler.lookup.MethodBinding;
import org.eclipse.jdt.internal.compiler.lookup.Scope;
@@ -297,6 +299,26 @@ final class PatchFixesHider {
}
}
+ /** Contains patch code to support Javadoc for generated methods */
+ public static final class Javadoc {
+ private static final Method GET_HTML;
+ private static final Method PRINT_METHOD;
+
+ static {
+ Class<?> shadowed = Util.shadowLoadClass("lombok.eclipse.agent.PatchJavadoc");
+ GET_HTML = Util.findMethod(shadowed, "getHTMLContentFromSource", String.class, IJavaElement.class);
+ PRINT_METHOD = Util.findMethod(shadowed, "printMethod", AbstractMethodDeclaration.class, Integer.class, StringBuffer.class, TypeDeclaration.class);
+ }
+
+ public static String getHTMLContentFromSource(String original, IJavaElement member) {
+ return (String) Util.invokeMethod(GET_HTML, original, member);
+ }
+
+ public static StringBuffer printMethod(AbstractMethodDeclaration methodDeclaration, int tab, StringBuffer output, TypeDeclaration type) {
+ return (StringBuffer) Util.invokeMethod(PRINT_METHOD, methodDeclaration, tab, output, type);
+ }
+ }
+
/**
* Contains a mix of methods: ecj only, ecj+eclipse, and eclipse only. As a consequence, _EVERY_ method from here used for ecj MUST be
* transplanted, as ecj itself cannot load this class (signatures refer to things that don't exist in ecj-only mode).