aboutsummaryrefslogtreecommitdiff
path: root/src/eclipseAgent/lombok/eclipse/agent/PatchJavadoc.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/eclipseAgent/lombok/eclipse/agent/PatchJavadoc.java')
-rw-r--r--src/eclipseAgent/lombok/eclipse/agent/PatchJavadoc.java16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/eclipseAgent/lombok/eclipse/agent/PatchJavadoc.java b/src/eclipseAgent/lombok/eclipse/agent/PatchJavadoc.java
index 5b34917e..673c30fd 100644
--- a/src/eclipseAgent/lombok/eclipse/agent/PatchJavadoc.java
+++ b/src/eclipseAgent/lombok/eclipse/agent/PatchJavadoc.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2020 The Project Lombok Authors.
+ * Copyright (C) 2020-2021 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
@@ -103,8 +103,9 @@ public class PatchJavadoc {
private static class Reflection {
private static final Method javadoc2HTML;
private static final Method oldJavadoc2HTML;
+ private static final Method lsJavadoc2HTML;
static {
- Method a = null, b = null;
+ Method a = null, b = null, c = null;
try {
a = Permit.getMethod(JavadocContentAccess2.class, "javadoc2HTML", IMember.class, IJavaElement.class, String.class);
@@ -112,9 +113,13 @@ public class PatchJavadoc {
try {
b = Permit.getMethod(JavadocContentAccess2.class, "javadoc2HTML", IMember.class, String.class);
} catch (Throwable t) {}
+ try {
+ c = Permit.getMethod(Class.forName("org.eclipse.jdt.ls.core.internal.javadoc.JavadocContentAccess2"), "javadoc2HTML", IMember.class, IJavaElement.class, String.class);
+ } catch (Throwable t) {}
javadoc2HTML = a;
oldJavadoc2HTML = b;
+ lsJavadoc2HTML = c;
}
private static String javadoc2HTML(IMember member, IJavaElement element, String rawJavadoc) {
@@ -125,6 +130,13 @@ public class PatchJavadoc {
return null;
}
}
+ if (lsJavadoc2HTML != null) {
+ try {
+ return (String) lsJavadoc2HTML.invoke(null, member, element, rawJavadoc);
+ } catch (Throwable t) {
+ return null;
+ }
+ }
if (oldJavadoc2HTML != null) {
try {
return (String) oldJavadoc2HTML.invoke(null, member, rawJavadoc);