equal
deleted
inserted
replaced
56 * Gets a Trees object for a given CompilationTask. |
56 * Gets a Trees object for a given CompilationTask. |
57 * @param task the compilation task for which to get the Trees object |
57 * @param task the compilation task for which to get the Trees object |
58 * @throws IllegalArgumentException if the task does not support the Trees API. |
58 * @throws IllegalArgumentException if the task does not support the Trees API. |
59 */ |
59 */ |
60 public static Trees instance(CompilationTask task) { |
60 public static Trees instance(CompilationTask task) { |
61 if (!task.getClass().getName().equals("com.sun.tools.javac.api.JavacTaskImpl")) |
61 String taskClassName = task.getClass().getName(); |
|
62 if (!taskClassName.equals("com.sun.tools.javac.api.JavacTaskImpl") |
|
63 && !taskClassName.equals("com.sun.tools.javac.api.BasicJavacTask")) |
62 throw new IllegalArgumentException(); |
64 throw new IllegalArgumentException(); |
63 return getJavacTrees(CompilationTask.class, task); |
65 return getJavacTrees(CompilationTask.class, task); |
64 } |
66 } |
65 |
67 |
66 /** |
68 /** |