diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2013-10-10 20:41:29 +0200 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2013-10-10 23:24:04 +0200 |
commit | 08961edcfeef9b181621351e36bbc267f9395415 (patch) | |
tree | 8aa4f4ae8e6af3247a547d01bb1dee5f8e66cdf4 /src/utils/lombok/javac | |
parent | 728dddbc81d9f9bfbbd3f8217b8c94f3f201c83d (diff) | |
download | lombok-08961edcfeef9b181621351e36bbc267f9395415.tar.gz lombok-08961edcfeef9b181621351e36bbc267f9395415.tar.bz2 lombok-08961edcfeef9b181621351e36bbc267f9395415.zip |
Whoops, Classload errors running lombok on javac with backing JVM 7 or below; fixed.
Diffstat (limited to 'src/utils/lombok/javac')
-rw-r--r-- | src/utils/lombok/javac/Javac.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/utils/lombok/javac/Javac.java b/src/utils/lombok/javac/Javac.java index 554c778d..bdf5e7a0 100644 --- a/src/utils/lombok/javac/Javac.java +++ b/src/utils/lombok/javac/Javac.java @@ -103,6 +103,20 @@ public class Javac { return 6; } + private static final Class<?> DOCCOMMENTTABLE_CLASS; + + static { + Class<?> c = null; + try { + c = Class.forName("com.sun.tools.javac.tree.DocCommentTable"); + } catch (Throwable ignore) {} + DOCCOMMENTTABLE_CLASS = c; + } + + public static boolean instanceOfDocCommentTable(Object o) { + return DOCCOMMENTTABLE_CLASS != null && DOCCOMMENTTABLE_CLASS.isInstance(o); + } + /** * Checks if the given expression (that really ought to refer to a type * expression) represents a primitive type. |