langtools/src/share/classes/com/sun/source/util/Trees.java
changeset 14548 aa687b312c97
parent 14541 36f9d11fc9aa
child 16303 b5dca0b42963
equal deleted inserted replaced
14547:86d8d242b0c4 14548:aa687b312c97
    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     /**