Lines Matching refs:file

12  * version 2 for more details (a copy is included in the LICENSE file that
40 * Run the program. A base directory can be provided for file arguments.
43 * @param baseDir base directory for any file arguments.
77 for (File file: files) {
78 if (file.exists())
79 test(file);
81 error("File not found: " + file);
112 * Test a file. If the file is a directory, it will be recursively scanned
114 * @param file the file or directory to test
116 void test(File file) {
117 if (file.isDirectory()) {
118 for (File f: file.listFiles()) {
124 if (file.isFile() && file.getName().endsWith(".java")) {
127 System.err.println(file);
129 treeCount += test(read(file));
132 error("Error parsing " + file + "\n" + e.getMessage());
135 error("Error reading " + file + ": " + e);
141 error("File " + file + " ignored");
154 * Read a file.
155 * @param file the file to be read
156 * @return the tree for the content of the file
158 * @throws TreePosTest.ParseException if any errors occur while parsing the file
160 JCCompilationUnit read(File file) throws IOException, ParseException {
163 Iterable<? extends JavaFileObject> files = fm.getJavaFileObjects(file);
193 void error(JavaFileObject file, String msg) {
194 System.err.println(file.getName() + ": " + msg);
200 * @param file the source file for the tree
204 void error(JavaFileObject file, Tree tree, String msg) {
206 error(file.getName() + ":" + getLine(file, t) + ": " + msg + " " + trim(t, 64));
231 * Thrown when errors are found parsing a java file.
281 * However, note that a file manager such as JavacFileManager is likely
282 * to cache the results of file.getCharContent, avoiding the need to read
285 int getLine(JavaFileObject file, JCTree tree) {
287 CharSequence cs = file.getCharContent(true);