Class JavaDiagnosticReader
java.lang.Object
org.checkerframework.framework.test.diagnostics.JavaDiagnosticReader
- All Implemented Interfaces:
Closeable,AutoCloseable,Iterator<TestDiagnosticLine>
This class reads expected javac diagnostics from a single file. Its implementation is as an
iterator over
TestDiagnosticLine. However, clients should call the static methods: readJavaSourceFiles(java.lang.Iterable<? extends java.lang.Object>) reads diagnostics from multiple Java source files, and readDiagnosticFiles(java.lang.Iterable<? extends java.io.File>) reads diagnostics from multiple "diagnostic files".-
Method Summary
Modifier and TypeMethodDescriptionprotected voidadvance()voidclose()booleanhasNext()next()static List<TestDiagnostic> readDiagnosticFiles(Iterable<? extends File> files) Reads diagnostics line-by-line from the input diagnostic files.static List<TestDiagnostic> readJavaSourceFiles(Iterable<? extends Object> files) Returns all the diagnostics in any of the Java source files.voidremove()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining
-
Method Details
-
readJavaSourceFiles
Returns all the diagnostics in any of the Java source files.- Parameters:
files- the Java files to read; each is a File or a JavaFileObject- Returns:
- the TestDiagnostics from the input file
-
readDiagnosticFiles
Reads diagnostics line-by-line from the input diagnostic files.- Parameters:
files- a set of diagnostic files- Returns:
- the TestDiagnosticLines from the input files
-
hasNext
- Specified by:
hasNextin interfaceIterator<TestDiagnosticLine>
-
remove
public void remove()- Specified by:
removein interfaceIterator<TestDiagnosticLine>
-
next
- Specified by:
nextin interfaceIterator<TestDiagnosticLine>
-
advance
@RequiresNonNull("reader") protected void advance(@UnknownInitialization JavaDiagnosticReader this) throws IOException - Throws:
IOException
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-