langtools/src/share/classes/com/sun/source/util/Trees.java
changeset 1789 7ac8c0815000
parent 1264 076a3cde30d5
child 3149 0cd06d598d6f
equal deleted inserted replaced
1788:ced0a1a7ec80 1789:7ac8c0815000
    72     private static Trees getJavacTrees(Class<?> argType, Object arg) {
    72     private static Trees getJavacTrees(Class<?> argType, Object arg) {
    73         try {
    73         try {
    74             ClassLoader cl = arg.getClass().getClassLoader();
    74             ClassLoader cl = arg.getClass().getClassLoader();
    75             Class<?> c = Class.forName("com.sun.tools.javac.api.JavacTrees", false, cl);
    75             Class<?> c = Class.forName("com.sun.tools.javac.api.JavacTrees", false, cl);
    76             argType = Class.forName(argType.getName(), false, cl);
    76             argType = Class.forName(argType.getName(), false, cl);
    77             Method m = c.getMethod("instance", new Class[] { argType });
    77             Method m = c.getMethod("instance", new Class<?>[] { argType });
    78             return (Trees) m.invoke(null, new Object[] { arg });
    78             return (Trees) m.invoke(null, new Object[] { arg });
    79         } catch (Throwable e) {
    79         } catch (Throwable e) {
    80             throw new AssertionError(e);
    80             throw new AssertionError(e);
    81         }
    81         }
    82     }
    82     }