/*
* 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.
*/
// JCOV
// end JCOV
/**
* Main program of the Java compiler
*
* WARNING: The contents of this source file are not part of any
* supported API. Code that depends on them does so at its own risk:
* they are subject to change or removal without notice.
*
* @deprecated As of J2SE 1.3, the preferred way to compile Java
* language sources is by using the new compiler,
* com.sun.tools.javac.Main.
*/
public
/**
* Name of the program.
*/
/**
* The stream where error message are printed.
*/
/**
* Constructor.
*/
}
/**
* Exit status.
* We introduce a separate integer status variable, and do not alter the
* convention that 'compile' returns a boolean true upon a successful
* compilation with no errors. (JavaTest relies on this.)
*/
private int exitStatus;
public int getExitStatus() {
return exitStatus;
}
public boolean compilationPerformedSuccessfully() {
}
public boolean compilationReportedErrors () {
return exitStatus != EXIT_OK;
}
/**
* Output a message.
*/
: new PrintStream(this.out, true);
}
/**
* Top level error message. This method is called when the
* environment could not be set up yet.
*/
}
}
}
/**
* Print usage message and make exit status an error.
* Note: 'javac' invoked without any arguments is considered
* be an error.
*/
public void usage_error() {
}
/**
* Initialize ResourceBundle
*/
static void initResource() {
try {
} catch (MissingResourceException e) {
throw new Error("Fatal: Resource for javac is missing");
}
}
/**
* get and format message string from resource
*/
}
}
}
}
initResource();
}
try {
} catch (MissingResourceException e) {
}
}
// What major and minor version numbers to use for the -target flag.
// This should grow every time the minor version number accepted by
// the VM is incremented.
/**
* Run the compiler
*/
boolean verbosePath = false;
short majorVersion = JAVA_DEFAULT_VERSION;
short minorVersion = JAVA_DEFAULT_MINOR_VERSION;
//JCOV
//end JCOV
boolean nowrite = false;
// These flags are used to make sure conflicting -O and -g
// options aren't given.
// Pre-process command line for @file arguments
try {
} catch (FileNotFoundException e) {
} catch (IOException e) {
e.printStackTrace();
}
// Parse arguments
prior_g = "-g";
flags |= F_DEBUG_LINES;
flags |= F_DEBUG_VARS;
flags |= F_DEBUG_SOURCE;
prior_g = "-g:none";
flags &= ~F_DEBUG_LINES;
flags &= ~F_DEBUG_VARS;
flags &= ~F_DEBUG_SOURCE;
// We choose to have debugging options conflict even
// if they amount to the same thing (for example,
// -g:source,lines and -g:lines,source). However, multiple
// debugging options are allowed if they are textually
// identical.
flags &= ~F_DEBUG_LINES;
flags &= ~F_DEBUG_VARS;
flags &= ~F_DEBUG_SOURCE;
while (true) {
flags |= F_DEBUG_LINES;
flags |= F_DEBUG_VARS;
flags |= F_DEBUG_SOURCE;
} else {
usage_error();
return false; // Stop processing now
}
}
// -O is accepted for backward compatibility, but
// is no longer effective. Use the undocumented
// -XO option to get the old behavior.
prior_O = "-O";
flags &= ~F_WARNINGS;
flags |= F_DEPRECATION;
nowrite = true;
if (classPathArg!=null) {
}
classPathArg = argv[++i];
} else {
usage_error();
return false; // Stop processing now
}
if (sourcePathArg != null) {
}
sourcePathArg = argv[++i];
} else {
usage_error();
return false; // Stop processing now
}
if (sysClassPathArg != null) {
}
sysClassPathArg = argv[++i];
} else {
usage_error();
return false; // Stop processing now
}
if (sysClassPathArg != null) {
}
sysClassPathArg = argv[++i];
} else {
usage_error();
return false; // Stop processing now
}
if (extDirsArg != null) {
}
extDirsArg = argv[++i];
} else {
usage_error();
return false; // Stop processing now
}
} else {
usage_error();
return false; // Stop processing now
}
int j;
majorVersion = majorVersions[j];
minorVersion = minorVersions[j];
break;
}
}
usage_error();
return false; // Stop processing now
}
} else {
usage_error();
return false; // Stop processing now
}
usage_error();
return false; // Stop processing now
}
} else {
usage_error();
return false; // Stop processing now
}
// JCOV
flags |= F_COVERAGE;
flags &= ~F_OPT_INTERCLASS;
flags &= ~F_OPT_INTERCLASS;
flags |= F_COVERAGE;
// end JCOV
// This is what -O used to be. Now undocumented.
prior_O = "-XO";
prior_O = "-Xinterclass";
flags |= F_DEPENDENCIES;
flags |= F_DEPENDENCIES;
// Unadvertised option used by JWS. The non-X version should
// be removed, but we'll leave it in until we find out for
// sure that no one still depends on that option syntax.
// change the default output in this case:
}
// Make strict floating point the default
flags |= F_STRICTDEFAULT;
verbosePath = true;
error("main.unsupported.usage");
return false; // Stop processing now
// Inform the compiler that it need not target VMs
// earlier than version 1.2. This option is here
// for testing purposes only. It is deliberately
// kept orthogonal to the -target option in 1.2.0
// for the sake of stability. These options will
// be merged in a future release.
flags |= F_VERSION12;
v.addElement(argv[i]);
} else {
usage_error();
return false; // Stop processing now
}
}
usage_error();
return false;
}
// Create our Environment.
if (verbosePath) {
}
// JCOV
// end JCOV
// Preload the "out of memory" error string just in case we run
// out of memory during the compile.
try {
// Parse all input files
try {
} catch (FileNotFoundException ee) {
}
}
// Do a post-read check on all newly-parsed classes,
// after they have all been read.
if (c.getClassDefinition().isLocal())
continue;
try {
} catch (ClassNotFound ee) {
}
}
}
// compile all classes that need compilation
boolean done;
do {
done = true;
env.flushErrors();
switch (c.getStatus()) {
case CS_UNDEFINED:
if (!env.dependencies()) {
break;
}
// fall through
case CS_SOURCE:
if (tracing)
done = false;
env.loadDefinition(c);
if (tracing)
break;
}
// fall through
case CS_PARSED:
if (c.getClassDefinition().isInsideLocal()) {
// the enclosing block will check this one
if (tracing)
continue;
}
done = false;
// fall through
case CS_CHECKED:
// bail out if there were any errors
if (tracing)
break;
}
done = false;
if (tracing)
continue;
}
}
} else {
}
} else {
continue;
}
}
// Create the file
try {
}
} catch (IOException ee) {
}
// Print class dependencies if requested (-xdepend)
if (env.print_dependencies()) {
}
}
}
} while (!done);
} catch (OutOfMemoryError ee) {
// The compiler has run out of memory. Use the error string
// which we preloaded.
return false;
} catch (StackOverflowError ee) {
return false;
// We allow the compiler to take an exception silently if a program
// error has previously been detected. Presumably, this makes the
// compiler more robust in the face of bad error recovery.
}
}
}
if (env.deprecation()) {
if (ndepfiles > 1) {
} else {
}
} else {
if (ndepfiles > 1) {
} else {
}
}
}
env.flushErrors();
boolean status = true;
} else {
}
} else {
}
}
if (exitStatus == EXIT_OK) {
// Allow EXIT_CMDERR or EXIT_ABNORMAL to take precedence.
}
status = false;
} else {
} else {
}
}
}
//JCOV
}
// end JCOV
// We're done
}
return status;
}
/**
* Main program
*/
// This is superceeded by the -Xstdout option, but we leave
// in the old property check for compatibility.
}
}
}