Java Code Examples for com.sun.tools.javac.file.JavacFileManager#getFileForInput()

The following examples show how to use com.sun.tools.javac.file.JavacFileManager#getFileForInput() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: T6358168.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public static void main(String... args) throws Throwable {

        JavacFileManager fm = new JavacFileManager(new Context(), false, null);
        JavaFileObject f = fm.getFileForInput(testSrc + File.separatorChar + T6358168.class.getName() + ".java");

        try {
            // first, test case with no annotation processing
            testNoAnnotationProcessing(fm, f);

            // now, test case with annotation processing
            testAnnotationProcessing(fm, f);
        }
        catch (Throwable t) {
            AssertionError e = new AssertionError();
            e.initCause(t);
            throw e;
        }
    }
 
Example 2
Source File: T6358168.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public static void main(String... args) throws Throwable {

        JavacFileManager fm = new JavacFileManager(new Context(), false, null);
        JavaFileObject f = fm.getFileForInput(testSrc + File.separatorChar + T6358168.class.getName() + ".java");

        try {
            // first, test case with no annotation processing
            testNoAnnotationProcessing(fm, f);

            // now, test case with annotation processing
            testAnnotationProcessing(fm, f);
        }
        catch (Throwable t) {
            AssertionError e = new AssertionError();
            e.initCause(t);
            throw e;
        }
    }
 
Example 3
Source File: T6358024.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public static void main(String... args) throws Throwable {
    String self = T6358024.class.getName();

    String testSrc = System.getProperty("test.src");

    fm = new JavacFileManager(new Context(), false, null);
    JavaFileObject f = fm.getFileForInput(testSrc + File.separatorChar + self + ".java");

    test(fm, f,
         new Option[] { new Option("-d", ".")},
         7);

    test(fm, f,
         new Option[] { new XOption("-XprintRounds"),
                        new Option("-processorpath", "."),
                        new Option("-processor", self) },
         12);
}
 
Example 4
Source File: T6358168.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public static void main(String... args) throws Throwable {

        JavacFileManager fm = new JavacFileManager(new Context(), false, null);
        JavaFileObject f = fm.getFileForInput(testSrc + File.separatorChar + T6358168.class.getName() + ".java");

        try {
            // first, test case with no annotation processing
            testNoAnnotationProcessing(fm, f);

            // now, test case with annotation processing
            testAnnotationProcessing(fm, f);
        }
        catch (Throwable t) {
            AssertionError e = new AssertionError();
            e.initCause(t);
            throw e;
        }
    }
 
Example 5
Source File: T6358024.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public static void main(String... args) throws Throwable {
    String self = T6358024.class.getName();

    String testSrc = System.getProperty("test.src");

    fm = new JavacFileManager(new Context(), false, null);
    JavaFileObject f = fm.getFileForInput(testSrc + File.separatorChar + self + ".java");

    test(fm, f,
         new Option[] { new Option("-d", ".")},
         7);

    test(fm, f,
         new Option[] { new XOption("-XprintRounds"),
                        new Option("-processorpath", "."),
                        new Option("-processor", self) },
         12);
}
 
Example 6
Source File: T6358168.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public static void main(String... args) throws Throwable {

        JavacFileManager fm = new JavacFileManager(new Context(), false, null);
        JavaFileObject f = fm.getFileForInput(testSrc + File.separatorChar + T6358168.class.getName() + ".java");

        try {
            // first, test case with no annotation processing
            testNoAnnotationProcessing(fm, f);

            // now, test case with annotation processing
            testAnnotationProcessing(fm, f);
        }
        catch (Throwable t) {
            AssertionError e = new AssertionError();
            e.initCause(t);
            throw e;
        }
    }
 
Example 7
Source File: T6358024.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public static void main(String... args) throws Throwable {
    String self = T6358024.class.getName();

    String testSrc = System.getProperty("test.src");

    fm = new JavacFileManager(new Context(), false, null);
    JavaFileObject f = fm.getFileForInput(testSrc + File.separatorChar + self + ".java");

    test(fm, f,
         new Option[] { new Option("-d", ".")},
         7);

    test(fm, f,
         new Option[] { new XOption("-XprintRounds"),
                        new Option("-processorpath", "."),
                        new Option("-processor", self) },
         12);
}
 
Example 8
Source File: T6725036.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
void run() throws Exception {
    RelativeFile TEST_ENTRY_NAME = new RelativeFile("java/lang/String.class");

    File testJar = createJar("test.jar", "java.lang.*");

    try (JarFile j = new JarFile(testJar)) {
        JarEntry je = j.getJarEntry(TEST_ENTRY_NAME.getPath());
        long jarEntryTime = je.getTime();

        Context context = new Context();
        JavacFileManager fm = new JavacFileManager(context, false, null);
        fm.setLocation(StandardLocation.CLASS_PATH, Collections.singletonList(testJar));
        FileObject fo =
            fm.getFileForInput(StandardLocation.CLASS_PATH, "", TEST_ENTRY_NAME.getPath());
        long jfoTime = fo.getLastModified();

        check(je, jarEntryTime, fo, jfoTime);

        if (errors > 0)
            throw new Exception(errors + " occurred");
    }
}
 
Example 9
Source File: T6358024.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public static void main(String... args) throws Throwable {
    String self = T6358024.class.getName();

    String testSrc = System.getProperty("test.src");

    fm = new JavacFileManager(new Context(), false, null);
    JavaFileObject f = fm.getFileForInput(testSrc + File.separatorChar + self + ".java");

    test(fm, f,
         new Option[] { new Option("-d", ".")},
         7);

    test(fm, f,
         new Option[] { new XOption("-XprintRounds"),
                        new Option("-processorpath", "."),
                        new Option("-processor", self) },
         12);
}
 
Example 10
Source File: T6358024.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public static void main(String... args) throws Throwable {
    String self = T6358024.class.getName();

    String testSrc = System.getProperty("test.src");

    fm = new JavacFileManager(new Context(), false, null);
    JavaFileObject f = fm.getFileForInput(testSrc + File.separatorChar + self + ".java");

    test(fm, f,
         new Option[] { new Option("-d", ".")},
         7);

    test(fm, f,
         new Option[] { new XOption("-XprintRounds"),
                        new Option("-processorpath", "."),
                        new Option("-processor", self) },
         12);
}
 
Example 11
Source File: T6358168.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public static void main(String... args) throws Throwable {

        JavacFileManager fm = new JavacFileManager(new Context(), false, null);
        JavaFileObject f = fm.getFileForInput(testSrc + File.separatorChar + T6358168.class.getName() + ".java");

        try {
            // first, test case with no annotation processing
            testNoAnnotationProcessing(fm, f);

            // now, test case with annotation processing
            testAnnotationProcessing(fm, f);
        }
        catch (Throwable t) {
            AssertionError e = new AssertionError();
            e.initCause(t);
            throw e;
        }
    }
 
Example 12
Source File: T6358024.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public static void main(String... args) throws Throwable {
    String self = T6358024.class.getName();

    String testSrc = System.getProperty("test.src");

    fm = new JavacFileManager(new Context(), false, null);
    JavaFileObject f = fm.getFileForInput(testSrc + File.separatorChar + self + ".java");

    test(fm, f,
         new Option[] { new Option("-d", ".")},
         7);

    test(fm, f,
         new Option[] { new XOption("-XprintRounds"),
                        new Option("-processorpath", "."),
                        new Option("-processor", self) },
         12);
}
 
Example 13
Source File: T6358168.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public static void main(String... args) throws Throwable {

        JavacFileManager fm = new JavacFileManager(new Context(), false, null);
        JavaFileObject f = fm.getFileForInput(testSrc + File.separatorChar + T6358168.class.getName() + ".java");

        try {
            // first, test case with no annotation processing
            testNoAnnotationProcessing(fm, f);

            // now, test case with annotation processing
            testAnnotationProcessing(fm, f);
        }
        catch (Throwable t) {
            AssertionError e = new AssertionError();
            e.initCause(t);
            throw e;
        }
    }
 
Example 14
Source File: T6358024.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public static void main(String... args) throws Throwable {
    String self = T6358024.class.getName();

    String testSrc = System.getProperty("test.src");

    fm = new JavacFileManager(new Context(), false, null);
    JavaFileObject f = fm.getFileForInput(testSrc + File.separatorChar + self + ".java");

    test(fm, f,
         new Option[] { new Option("-d", ".")},
         7);

    test(fm, f,
         new Option[] { new XOption("-XprintRounds"),
                        new Option("-processorpath", "."),
                        new Option("-processor", self) },
         12);
}
 
Example 15
Source File: T6358168.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public static void main(String... args) throws Throwable {

        JavacFileManager fm = new JavacFileManager(new Context(), false, null);
        JavaFileObject f = fm.getFileForInput(testSrc + File.separatorChar + T6358168.class.getName() + ".java");

        try {
            // first, test case with no annotation processing
            testNoAnnotationProcessing(fm, f);

            // now, test case with annotation processing
            testAnnotationProcessing(fm, f);
        }
        catch (Throwable t) {
            AssertionError e = new AssertionError();
            e.initCause(t);
            throw e;
        }
    }
 
Example 16
Source File: T6358166.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 3 votes vote down vote up
public static void main(String... args) throws Throwable {
    String self = T6358166.class.getName();

    String testSrc = System.getProperty("test.src");

    JavacFileManager fm = new JavacFileManager(new Context(), false, null);
    JavaFileObject f = fm.getFileForInput(testSrc + File.separatorChar + self + ".java");

    test(fm, f, "-verbose", "-d", ".");

    test(fm, f, "-verbose", "-d", ".", "-XprintRounds", "-processorpath", ".", "-processor", self);
}
 
Example 17
Source File: T6358166.java    From TencentKona-8 with GNU General Public License v2.0 3 votes vote down vote up
public static void main(String... args) throws Throwable {
    String self = T6358166.class.getName();

    String testSrc = System.getProperty("test.src");

    JavacFileManager fm = new JavacFileManager(new Context(), false, null);
    JavaFileObject f = fm.getFileForInput(testSrc + File.separatorChar + self + ".java");

    test(fm, f, "-verbose", "-d", ".");

    test(fm, f, "-verbose", "-d", ".", "-XprintRounds", "-processorpath", ".", "-processor", self);
}
 
Example 18
Source File: T6358166.java    From openjdk-jdk8u with GNU General Public License v2.0 3 votes vote down vote up
public static void main(String... args) throws Throwable {
    String self = T6358166.class.getName();

    String testSrc = System.getProperty("test.src");

    JavacFileManager fm = new JavacFileManager(new Context(), false, null);
    JavaFileObject f = fm.getFileForInput(testSrc + File.separatorChar + self + ".java");

    test(fm, f, "-verbose", "-d", ".");

    test(fm, f, "-verbose", "-d", ".", "-XprintRounds", "-processorpath", ".", "-processor", self);
}
 
Example 19
Source File: T6358166.java    From openjdk-8-source with GNU General Public License v2.0 3 votes vote down vote up
public static void main(String... args) throws Throwable {
    String self = T6358166.class.getName();

    String testSrc = System.getProperty("test.src");

    JavacFileManager fm = new JavacFileManager(new Context(), false, null);
    JavaFileObject f = fm.getFileForInput(testSrc + File.separatorChar + self + ".java");

    test(fm, f, "-verbose", "-d", ".");

    test(fm, f, "-verbose", "-d", ".", "-XprintRounds", "-processorpath", ".", "-processor", self);
}
 
Example 20
Source File: T6358166.java    From jdk8u60 with GNU General Public License v2.0 3 votes vote down vote up
public static void main(String... args) throws Throwable {
    String self = T6358166.class.getName();

    String testSrc = System.getProperty("test.src");

    JavacFileManager fm = new JavacFileManager(new Context(), false, null);
    JavaFileObject f = fm.getFileForInput(testSrc + File.separatorChar + self + ".java");

    test(fm, f, "-verbose", "-d", ".");

    test(fm, f, "-verbose", "-d", ".", "-XprintRounds", "-processorpath", ".", "-processor", self);
}