langtools/test/tools/javac/flow/LVTHarness.java
changeset 27319 030080f03e4f
parent 26784 6be305e56bcb
child 28330 d4bcdcac1211
equal deleted inserted replaced
27318:4660a5da7d90 27319:030080f03e4f
    74 
    74 
    75     static final JavaCompiler comp = ToolProvider.getSystemJavaCompiler();
    75     static final JavaCompiler comp = ToolProvider.getSystemJavaCompiler();
    76     static final StandardJavaFileManager fm = comp.getStandardFileManager(null, null, null);
    76     static final StandardJavaFileManager fm = comp.getStandardFileManager(null, null, null);
    77 
    77 
    78     public static void main(String[] args) throws Exception {
    78     public static void main(String[] args) throws Exception {
    79 
    79         try {
    80         String testDir = System.getProperty("test.src");
    80             String testDir = System.getProperty("test.src");
    81         fm.setLocation(SOURCE_PATH, Arrays.asList(new File(testDir, "tests")));
    81             fm.setLocation(SOURCE_PATH, Arrays.asList(new File(testDir, "tests")));
    82 
    82 
    83         // Make sure classes are written to scratch dir.
    83             // Make sure classes are written to scratch dir.
    84         fm.setLocation(CLASS_OUTPUT, Arrays.asList(new File(".")));
    84             fm.setLocation(CLASS_OUTPUT, Arrays.asList(new File(".")));
    85 
    85 
    86         for (JavaFileObject jfo : fm.list(SOURCE_PATH, "", Collections.singleton(SOURCE), true)) {
    86             for (JavaFileObject jfo : fm.list(SOURCE_PATH, "", Collections.singleton(SOURCE), true)) {
    87             new LVTHarness(jfo).check();
    87                 new LVTHarness(jfo).check();
    88         }
    88             }
    89         if (nerrors > 0) {
    89             if (nerrors > 0) {
    90             throw new AssertionError("Errors were found");
    90                 throw new AssertionError("Errors were found");
       
    91             }
       
    92         } finally {
       
    93             fm.close();
    91         }
    94         }
    92     }
    95     }
    93 
    96 
    94 
    97 
    95     JavaFileObject jfo;
    98     JavaFileObject jfo;