/*
* 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.
*/
/*****************************************************************************/
/* Copyright (c) IBM Corporation 1998 */
/* */
/* (C) Copyright IBM Corp. 1998 */
/* */
/*****************************************************************************/
/**
* BatchEnvironment for rmic extends javac's version in four ways:
* 1. It overrides errorString() to handle looking for rmic-specific
* error messages in rmic's resource bundle
* 2. It provides a mechanism for recording intermediate generated
* files so that they can be deleted later.
* 3. It holds a reference to the Main instance so that generators
* can refer to it.
* 4. It provides access to the ClassPath passed to the constructor.
*
* 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.
*/
/** instance of Main which created this environment */
/**
* Create a ClassPath object for rmic from a class path string.
*/
return paths[1];
}
/**
* Create a ClassPath object for rmic from the relevant command line
* options for class path, boot class path, and extension directories.
*/
{
/**
* Previously, this method delegated to the
* sun.tools.javac.BatchEnvironment.classPaths method in order
* to supply default values for paths not specified on the
* command line, expand extensions directories into specific
* JAR files, and construct the ClassPath object-- but as part
* of the fix for 6473331, which adds support for Class-Path
* manifest entries in JAR files, those steps are now handled
* here directly, with the help of a Path utility class copied
* from the new javac implementation (see below).
*/
if (sysClassPathString == null) {
}
if (sysClassPathString != null) {
}
/*
* Class-Path manifest entries are supported for JAR files
* everywhere except in the boot class path.
*/
path.expandJarClassPaths(true);
if (extDirsString == null) {
}
if (extDirsString != null) {
}
/*
* In the application class path, an empty element means
* the current working directory.
*/
if (classPathString == null) {
// The env.class.path property is the user's CLASSPATH
// environment variable, and it set by the wrapper (ie,
// javac.exe).
if (classPathString == null) {
classPathString = ".";
}
}
}
/**
* Create a BatchEnvironment for rmic with the given class path,
* stream for messages and Main.
*/
// use empty "sourcePath" (see 4666958)
}
/**
* Get the instance of Main which created this environment.
*/
return main;
}
/**
* Get the ClassPath.
*/
return binaryPath;
}
/** list of generated source files created in this environment */
/**
* Remember a generated source file generated so that it
* can be removed later, if appropriate.
*/
}
/**
* Delete all the generated source files made during the execution
* of this environment (those that have been registered with the
* "addGeneratedFile" method).
*/
public void deleteGeneratedFiles() {
synchronized(generatedFiles) {
while (enumeration.hasMoreElements()) {
}
}
}
/**
* Release resources, if any.
*/
public void shutdown() {
super.shutdown();
}
/**
* Return the formatted, localized string for a named error message
* and supplied arguments. For rmic error messages, with names that
* being with "rmic.", look up the error message in rmic's resource
* bundle; otherwise, defer to java's superclass method.
*/
{
}
return result;
} else {
}
}
public void reset() {
}
/**
* Utility for building paths of directories and JAR files. This
* class was copied from com.sun.tools.javac.util.Paths as part of
* the fix for 6473331, which adds support for Class-Path manifest
* entries in JAR files. Diagnostic code is simply commented out
* because rmic silently ignored these conditions historically.
*/
private static final boolean warn = false;
this.emptyPathDefault = emptyPathDefault;
}
public boolean hasNext() {
}
if (end == -1)
return emptyPathDefault;
else
}
public void remove() {
throw new UnsupportedOperationException();
}
};
}
// required for Collection.
public int size() {
throw new UnsupportedOperationException();
}
public boolean isEmpty() {
throw new UnsupportedOperationException();
}
throw new UnsupportedOperationException();
}
throw new UnsupportedOperationException();
}
public <T> T[] toArray(T[] a) {
throw new UnsupportedOperationException();
}
throw new UnsupportedOperationException();
}
throw new UnsupportedOperationException();
}
throw new UnsupportedOperationException();
}
throw new UnsupportedOperationException();
}
throw new UnsupportedOperationException();
}
throw new UnsupportedOperationException();
}
public void clear() {
throw new UnsupportedOperationException();
}
throw new UnsupportedOperationException();
}
public int hashCode() {
throw new UnsupportedOperationException();
}
}
/** Is this the name of a zip file? */
}
private boolean expandJarClassPaths = false;
expandJarClassPaths = x;
return this;
}
/** What to use when path element is the empty string */
emptyPathDefault = x;
return this;
}
public Path() { super(); }
return this;
}
}
// if (warn)
// log.warning(Position.NOPOS,
// "dir.path.element.not.found", dir);
return;
}
}
}
return this;
}
}
/* Discard duplicates and avoid infinite recursion */
return;
}
/* No such file or directory exist */
if (warn)
// log.warning(Position.NOPOS,
// "path.element.not.found", file);
return;
}
/* File is an ordinay file */
/* File name don't have right extension */
// if (warn)
// log.warning(Position.NOPOS,
// "invalid.archive.file", file);
return;
}
}
/* Now what we have left is either a directory or a file name
confirming to archive naming convention */
}
// Adds referenced classpath elements from a jar's Class-Path
// Manifest entry. In some future release, we may want to
// update this code to recognize URLs rather than simple
// filenames, but if we do, we should redo all path-related code.
try {
try {
st.hasMoreTokens();) {
}
} finally {
}
} catch (IOException e) {
// log.error(Position.NOPOS,
// "error.reading.file", jarFileName,
// e.getLocalizedMessage());
}
}
}
}