/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* <p><b>This is NOT part of any supported API.
* If you write code that depends on this, you do so at your own
* risk. This code and its internal interfaces are subject to change
* or deletion without notice.</b>
*/
@SuppressWarnings("deprecation")
/** The context key for the compiler. */
/** Get the JavaCompiler instance for this context. */
return instance;
}
return genSourceFileNames;
}
/** List of names of generated class files.
*/
return genClassFileNames;
}
return aggregateGenFiles;
}
/** The bark to be used for error reporting.
*/
/** The log to be used for error reporting.
*/
/** The annotation framework
*/
return context;
}
/** Construct a new compiler from a shared context.
*/
super(preRegister(context));
classReader.preferSource = true;
// TEMPORARY NOTE: bark==log, but while refactoring, we maintain their
// original identities, to remember the original intent.
// this forces a copy of the line map to be kept in the tree,
// for use by com.sun.mirror.util.SourcePosition.
lineDebugInfo = true;
}
/* Switches:
*/
/** Emit class files. This switch is always set, except for the first
* phase of retrofitting, where signatures are parsed.
*/
public boolean classOutput;
/** The internal printing annotation processor should be used.
*/
public boolean print;
/** Compilation should not be done after annotation processing.
*/
public boolean nocompile;
/** Are class files being treated as declarations
*/
public boolean classesAsDecls;
/** Try to open input stream with given name.
* Report an error if this fails.
* @param filename The file name of the input stream to be opened.
*/
// PROVIDED FOR EXTREME BACKWARDS COMPATIBILITY
// There are some very obscure errors that can arise while translating
// the contents of a file from bytes to characters. In Tiger, these
// diagnostics were ignored. This method provides compatibility with
// that behavior. It would be better to honor those diagnostics, in which
// case, this method can be deleted.
try {
try {
return filename.getCharContent(false);
}
finally {
}
} catch (IOException e) {
return null;
}
}
/** Parse contents of input stream.
* @param filename The name of the file from which input stream comes.
* @param input The input stream to be parsed.
*/
// PROVIDED FOR BACKWARDS COMPATIBILITY
// In Tiger, diagnostics from the scanner and parser were ignored.
// This method provides compatibility with that behavior.
// It would be better to honor those diagnostics, in which
// case, this method can be deleted.
try {
}
finally {
}
}
protected boolean keepComments() {
return true; // make doc comments available to mirror API impl.
}
/** Track when the JavaCompiler has been used to compile something. */
private boolean hasBeenUsed = false;
/** Main method: compile a list of files, return all compiled classes
* @param filenames The names of all files to be compiled.
*/
throws Throwable {
// as a JavaCompiler can only be used once, throw an exception if
// it has been used before.
assert !hasBeenUsed : "attempt to reuse JavaCompiler";
hasBeenUsed = true;
this.aggregateGenFiles = aggregateGenFiles;
try {
//parse all files
if (classesAsDecls) {
try {
continue;
}
continue;
}
}
}
//enter symbols for all files
if (errorCount() == 0) {
try {
}
finally {
}
}
if (errorCount() == 0) {
}
}
if (verbose)
}
}