langtools/src/share/classes/com/sun/source/util/Trees.java
changeset 22163 3651128c74eb
parent 20612 4761f3ff7afb
child 25287 d2440361b323
equal deleted inserted replaced
22162:3b3e23e67329 22163:3651128c74eb
    80     static Trees getJavacTrees(Class<?> argType, Object arg) {
    80     static Trees getJavacTrees(Class<?> argType, Object arg) {
    81         try {
    81         try {
    82             ClassLoader cl = arg.getClass().getClassLoader();
    82             ClassLoader cl = arg.getClass().getClassLoader();
    83             Class<?> c = Class.forName("com.sun.tools.javac.api.JavacTrees", false, cl);
    83             Class<?> c = Class.forName("com.sun.tools.javac.api.JavacTrees", false, cl);
    84             argType = Class.forName(argType.getName(), false, cl);
    84             argType = Class.forName(argType.getName(), false, cl);
    85             Method m = c.getMethod("instance", new Class<?>[] { argType });
    85             Method m = c.getMethod("instance", argType);
    86             return (Trees) m.invoke(null, new Object[] { arg });
    86             return (Trees) m.invoke(null, arg);
    87         } catch (Throwable e) {
    87         } catch (Throwable e) {
    88             throw new AssertionError(e);
    88             throw new AssertionError(e);
    89         }
    89         }
    90     }
    90     }
    91 
    91