553N/A * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. 488N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 488N/A * This code is free software; you can redistribute it and/or modify it 488N/A * under the terms of the GNU General Public License version 2 only, as 488N/A * published by the Free Software Foundation. 488N/A * This code is distributed in the hope that it will be useful, but WITHOUT 488N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 488N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 488N/A * version 2 for more details (a copy is included in the LICENSE file that 488N/A * accompanied this code). 488N/A * You should have received a copy of the GNU General Public License version 488N/A * 2 along with this work; if not, write to the Free Software Foundation, 488N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 553N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 553N/A * or visit www.oracle.com if you need additional information or have any 488N/A * Run the program. A base directory can be provided for file arguments. 488N/A * In jtreg mode, the -r option can be given to change the default base 488N/A * directory to the test root directory. For other options, see usage(). 488N/A * @param baseDir base directory for any file arguments. 488N/A * @param args command line args 488N/A * @return true if successful or in gui mode 488N/A * Print command line help. 488N/A * @param out output stream 488N/A out.
println(
"non java files, or java files which cannot be parsed, will be ignored");
488N/A * Test a file. If the file is a directory, it will be recursively scanned 488N/A * @param file the file or directory to test 488N/A * @param file the file to be read 488N/A * @return the tree for the content of the file 488N/A * @throws IOException if any IO errors occur 488N/A * @throws TreePosTest.ParseException if any errors occur while parsing the file 488N/A * Report an error. When the program is complete, the program will either 488N/A * exit or throw an Error if any errors have been reported. 488N/A * @param msg the error message 682N/A * Report an error. When the program is complete, the program will either 682N/A * exit or throw an Error if any errors have been reported. 682N/A * @param msg the error message 488N/A * Report an error for a specific tree node. 488N/A * @param file the source file for the tree 488N/A * @param t the tree node 488N/A * @param label an indication of the error 488N/A * Get a trimmed string for a tree node, with normalized white space and limited length. 488N/A /** Number of files that have been analyzed. */ 678N/A /** Number of trees that have been successfully compared. */ 488N/A /** Number of errors reported. */ 488N/A /** Flag: don't report irrelevant files. */ 488N/A /** Flag: report files as they are processed. */ 488N/A * Thrown when errors are found parsing a java file. 488N/A * DiagnosticListener to report diagnostics and count any errors that occur. 488N/A * Get the set of fields for a tree node that may contain child tree nodes. 488N/A * These are the fields that are subtypes of JCTree or List. 488N/A * The results are cached, based on the tree's tag. 488N/A /** Get the line number for the primary position for a tree. 488N/A * The code is intended to be simple, although not necessarily efficient. 488N/A * However, note that a file manager such as JavacFileManager is likely 488N/A * to cache the results of file.getCharContent, avoiding the need to read 488N/A * the bits from disk each time this method is called. 488N/A if (
cs.
charAt(i) ==
'\n')
// jtreg tests always use Unix line endings