src/share/classes/com/sun/source/util/DocTrees.java

changeset 1455
75ab654b5cd5
parent 1409
33abf479f202
child 1590
011cf7e0a148
equal deleted inserted replaced
1454:02a18f209ab3 1455:75ab654b5cd5
43 * Gets a DocTrees object for a given CompilationTask. 43 * Gets a DocTrees object for a given CompilationTask.
44 * @param task the compilation task for which to get the Trees object 44 * @param task the compilation task for which to get the Trees object
45 * @throws IllegalArgumentException if the task does not support the Trees API. 45 * @throws IllegalArgumentException if the task does not support the Trees API.
46 */ 46 */
47 public static DocTrees instance(CompilationTask task) { 47 public static DocTrees instance(CompilationTask task) {
48 if (!task.getClass().getName().equals("com.sun.tools.javac.api.JavacTaskImpl")) 48 return (DocTrees) Trees.instance(task);
49 throw new IllegalArgumentException();
50 return (DocTrees) getJavacTrees(CompilationTask.class, task);
51 } 49 }
52 50
53 /** 51 /**
54 * Gets a DocTrees object for a given ProcessingEnvironment. 52 * Gets a DocTrees object for a given ProcessingEnvironment.
55 * @param env the processing environment for which to get the Trees object 53 * @param env the processing environment for which to get the Trees object

mercurial