test/langtools/tools/javac/lib/combo/ComboInstance.java
changeset 58713 ad69fd32778e
parent 47216 71c04702a3d5
equal deleted inserted replaced
58712:14e098407bb0 58713:ad69fd32778e
    21  * questions.
    21  * questions.
    22  */
    22  */
    23 
    23 
    24 package combo;
    24 package combo;
    25 
    25 
       
    26 import java.lang.reflect.Method;
    26 import javax.tools.StandardJavaFileManager;
    27 import javax.tools.StandardJavaFileManager;
    27 import java.util.Optional;
    28 import java.util.Optional;
    28 
    29 
    29 /**
    30 /**
    30  * This class is the common superclass of all combo test instances. It defines few helper methods
    31  * This class is the common superclass of all combo test instances. It defines few helper methods
    55             resultStatus = ResultStatus.ERROR;
    56             resultStatus = ResultStatus.ERROR;
    56             env.info().errCount++;
    57             env.info().errCount++;
    57             env.info().lastError = Optional.of(ex);
    58             env.info().lastError = Optional.of(ex);
    58         } finally {
    59         } finally {
    59             this.env = null;
    60             this.env = null;
       
    61             try {
       
    62                 Class<?> fmClass = env.fileManager().getClass();
       
    63                 Method clear = fmClass.getMethod("clear");
       
    64                 clear.setAccessible(true);
       
    65                 clear.invoke(env.fileManager());
       
    66             } catch (Exception ex) {
       
    67                 throw new IllegalStateException(ex);
       
    68             }
    60         }
    69         }
    61     }
    70     }
    62 
    71 
    63     /**
    72     /**
    64      * Retrieve a unique ID associated with this test instance.
    73      * Retrieve a unique ID associated with this test instance.