/*
* 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.
*/
/** This class provides a commandline interface to the GJC compiler.
*
* <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>
*/
public class Main {
/** The name of the compiler, for use in diagnostics.
*/
/** The writer to use for diagnostic output.
*/
/**
* If true, certain errors will cause an exception, such as command line
* arg errors, or exceptions in user provided code.
*/
boolean apiMode;
/** Result codes.
*/
static final int
}
}
public void printVersion() {
}
public void printFullVersion() {
}
public void printHelp() {
help();
}
public void printXhelp() {
xhelp();
}
}
public void addClassName(String s) {
classnames.append(s);
}
});
/**
* Construct a compiler instance.
*/
}
/**
* Construct a compiler instance.
*/
}
/** A table of all options that's passed to the JavaCompiler constructor. */
/** The list of source files to process
*/
/** List of class files names passed on the command line
*/
/** Print a string that explains usage.
*/
void help() {
}
}
/** Print a string that explains usage for X options.
*/
void xhelp() {
}
}
/** Report a usage error.
*/
if (apiMode) {
}
}
/** Report a warning.
*/
}
return option;
}
return null;
}
throw new NullPointerException();
}
}
/** Process command line arguments: store all command line options
* in `options' table and return all source filenames.
* @param flags The array of command line arguments.
*/
}
int ac = 0;
ac++;
// quick hack to speed up file processing:
// if the option does not begin with '-', there is no need to check
// most of the compiler options.
option = recognizedOptions[j];
break;
}
}
}
return null;
}
return null;
}
ac++;
return null;
} else {
return null;
}
}
}
if (!checkDirectory(D))
return null;
if (!checkDirectory(S))
return null;
// profiles are not aligned with J2SE targets; moreover, a
// single CLDC target may have many profiles. In addition,
// this is needed for the continued functioning of the JSR14
// prototype.
if (targetString != null) {
if (sourceString == null) {
} else {
warning("warn.source.target.conflict",
}
return null;
} else {
}
} else {
}
}
}
// handle this here so it works even if no other options given
showClass = "com.sun.tools.javac.Main";
}
return filenames;
}
// where
return true;
return false;
}
if (!file.isDirectory()) {
return false;
}
return true;
}
/** Programmatic interface for main function.
* @param args The command line parameters.
*/
if (fileManager instanceof JavacFileManager) {
// A fresh context was created above, so jfm must be a JavacFileManager
}
return result;
}
}
/** Programmatic interface for main function.
* @param args The command line parameters.
*/
{
}
String[] classNames,
{
/*
* TODO: Logic below about what is an acceptable command line
* should be updated to take annotation processing semantics
* into account.
*/
try {
&& fileObjects.isEmpty()) {
help();
return EXIT_CMDERR;
}
try {
// null signals an error in options, abort
return EXIT_CMDERR;
// it is allowed to compile nothing if just asking for help or version info
return EXIT_OK;
error("err.no.source.files.classes");
} else {
error("err.no.source.files");
}
return EXIT_CMDERR;
}
getLocalizedString("err.file.not.found",
e.getMessage()));
return EXIT_SYSERR;
}
if (forceStdOut) {
}
// allow System property in following line as a Mustang legacy
if (batchMode)
// add filenames to fileObjects
}
classnames.toList(),
return EXIT_OK;
} else {
return EXIT_ERROR;
}
}
return EXIT_ERROR;
} catch (IOException ex) {
return EXIT_SYSERR;
} catch (OutOfMemoryError ex) {
return EXIT_SYSERR;
} catch (StackOverflowError ex) {
return EXIT_SYSERR;
} catch (FatalError ex) {
return EXIT_SYSERR;
} catch (AnnotationProcessingError ex) {
if (apiMode)
return EXIT_SYSERR;
} catch (ClientCodeException ex) {
// as specified by javax.tools.JavaCompiler#getTask
// and javax.tools.JavaCompiler.CompilationTask#call
} catch (PropagatedException ex) {
// Nasty. If we've already reported an error, compensate
// for buggy compiler error recovery by swallowing thrown
// exceptions.
bugMessage(ex);
return EXIT_ABNORMAL;
} finally {
try {
} catch (ClientCodeException ex) {
}
}
}
return EXIT_OK;
}
/** Print a message reporting an internal error.
*/
JavaCompiler.version()));
}
/** Print a message reporting a fatal error.
*/
}
}
*/
}
/** Print a message reporting an out-of-resources error.
*/
// System.out.println("(name buffer len = " + Name.names.length + " " + Name.nc);//DEBUG
}
/** Print a message reporting an uncaught exception from an
* annotation processor.
*/
getLocalizedString("msg.proc.annotation.uncaught.exception"));
}
/** Display the location and checksum of a class. */
else {
try {
byte[] digest;
try {
byte[] buf = new byte[8192];
int n;
} finally {
}
for (byte b: digest)
} catch (Exception e) {
}
}
}
/* ************************************************************************
* Internationalization
*************************************************************************/
/** Find a localized string in the resource bundle.
* @param key The key for the localized string.
*/
try {
}
catch (MissingResourceException e) {
throw new Error("Fatal Error: Resource for javac is missing", e);
}
}
if (enable) {
return key;
}
};
} else {
}
}
}