/*
* 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.
*/
/**
* "Main" class for javap, normally accessed from the command line
* via Main, or from JSR199 via DisassemblerTool.
*
* <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>
*/
}
showUsage = b;
return this;
}
boolean showUsage;
}
static abstract class Option {
}
return true;
}
return false;
}
boolean ignoreRest() {
return false;
}
final boolean hasArg;
}
}
},
new Option(false, "-version") {
}
},
new Option(false, "-fullversion") {
}
},
}
},
new Option(false, "-l") {
}
},
new Option(false, "-public") {
}
},
new Option(false, "-protected") {
}
},
new Option(false, "-package") {
}
},
}
}
},
new Option(false, "-c") {
}
},
new Option(false, "-s") {
}
},
// new Option(false, "-all") {
// void process(JavapTask task, String opt, String arg) {
// task.options.showAllAttrs = true;
// }
// },
new Option(false, "-h") {
}
},
}
},
new Option(false, "-sysinfo") {
}
},
new Option(false, "-Xold") {
}
},
new Option(false, "-Xnew") {
// ignore: this _is_ the new version
}
},
new Option(false, "-XDcompat") {
}
},
new Option(false, "-XDdetails") {
}
},
new Option(false, "-XDdetails:") {
}
}
}
return true;
return true;
}
boolean on = true;
on = false;
}
if (on)
else
return true;
}
}
return false;
}
},
new Option(false, "-constants") {
}
},
new Option(false, "-XDinner") {
}
},
new Option(false, "-XDindent:") {
}
try {
} catch (NumberFormatException e) {
}
}
},
new Option(false, "-XDtab:") {
}
try {
} catch (NumberFormatException e) {
}
}
}
};
public JavapTask() {
}
this();
this.fileManager = fileManager;
this.diagnosticListener = diagnosticListener;
}
}
try {
handleOptions(options, false);
} catch (BadArgs e) {
throw new IllegalArgumentException(e.getMessage());
}
}
}
}
}
return new PrintWriter(s, true);
}
if (w == null)
return getPrintWriterForStream(null);
else if (w instanceof PrintWriter)
return (PrintWriter) w;
else
return new PrintWriter(w, true);
}
}
}
}
return new DiagnosticListener<JavaFileObject> () {
switch (diagnostic.getKind()) {
case ERROR:
break;
case WARNING:
break;
case NOTE:
break;
}
}
};
}
/** Result codes.
*/
static final int
try {
// the following gives consistent behavior with javac
return EXIT_OK;
else
return EXIT_CMDERR;
}
try {
} finally {
if (defaultFileManager != null) {
try {
} catch (IOException e) {
throw new InternalError(e);
}
}
}
} catch (BadArgs e) {
if (e.showUsage) {
}
return EXIT_CMDERR;
} catch (InternalError e) {
else {
}
return EXIT_ABNORMAL;
} finally {
}
}
}
if (diagnosticListener == null)
} else {
if (diagnosticListener == null)
}
if (fileManager == null)
else if (allowClasses) {
} else
}
}
}
throw new BadArgs("err.no.classes.specified");
}
showHelp();
}
for (Option o: recognizedOptions) {
if (o.hasArg) {
else
} else
if (o.ignoreRest()) {
}
return;
}
}
return;
}
return run();
}
public boolean run() {
return false;
boolean ok = true;
try {
} catch (ConstantPoolException e) {
ok = false;
} catch (EOFException e) {
ok = false;
} catch (FileNotFoundException e) {
ok = false;
} catch (IOException e) {
//e.printStackTrace();
msg = e;
ok = false;
} catch (Throwable t) {
t.printStackTrace(pw);
ok = false;
}
}
return ok;
}
throws IOException, ConstantPoolException {
return false;
}
}
if (options.showInnerClasses) {
if (a instanceof InnerClasses_attribute) {
try {
boolean ok = true;
}
}
return ok;
} catch (ConstantPoolException e) {
return false;
}
} else if (a != null) {
return false;
}
}
return true;
}
// for compatibility, first see if it is a class name
return fo;
// see if it is an inner class, by replacing dots to $, starting from the right
int lastDot;
return fo;
}
return null;
if (fileManager instanceof StandardJavaFileManager) {
return fo;
}
}
// see if it is a URL, and if so, wrap it in just enough of a JavaFileObject
// to suit javap's needs
try {
return new JavaFileObject() {
}
throw new UnsupportedOperationException();
}
public NestingKind getNestingKind() {
throw new UnsupportedOperationException();
}
public Modifier getAccessLevel() {
throw new UnsupportedOperationException();
}
return uri;
}
}
return conn.getInputStream();
}
throw new UnsupportedOperationException();
}
throw new UnsupportedOperationException();
}
throw new UnsupportedOperationException();
}
throw new UnsupportedOperationException();
}
public long getLastModified() {
return conn.getLastModified();
}
public boolean delete() {
throw new UnsupportedOperationException();
}
};
} catch (URISyntaxException ignore) {
} catch (IOException ignore) {
}
}
return null;
}
public static class ClassFileInfo {
}
public final byte[] digest;
public final int size;
}
try {
try {
} catch (NoSuchAlgorithmException ignore) {
}
}
} finally {
}
}
}
}
}
}
}
}
}
}
}
}
}
private JavaFileManager getDefaultFileManager(final DiagnosticListener<? super JavaFileObject> dl, PrintWriter log) {
if (defaultFileManager == null)
return defaultFileManager;
}
fo = fileManager.getJavaFileForInput(StandardLocation.PLATFORM_CLASS_PATH, className, JavaFileObject.Kind.CLASS);
fo = fileManager.getJavaFileForInput(StandardLocation.CLASS_PATH, className, JavaFileObject.Kind.CLASS);
return fo;
}
private void showHelp() {
for (Option o: recognizedOptions) {
if (name.startsWith("X") || name.equals("fullversion") || name.equals("h") || name.equals("verify"))
continue;
}
continue;
}
}
}
// key=version: mm.nn.oo[-milestone]
// key=full: mm.mm.oo[-milestone]-build
try {
} catch (MissingResourceException e) {
}
}
try {
}
catch (MissingResourceException e) {
}
}
}
}
}
return new Diagnostic<JavaFileObject>() {
return kind;
}
public JavaFileObject getSource() {
return null;
}
public long getPosition() {
return Diagnostic.NOPOS;
}
public long getStartPosition() {
return Diagnostic.NOPOS;
}
public long getEndPosition() {
return Diagnostic.NOPOS;
}
public long getLineNumber() {
return Diagnostic.NOPOS;
}
public long getColumnNumber() {
return Diagnostic.NOPOS;
}
return key;
}
}
}
};
}
}
// could make this a HashMap<Locale,SoftReference<ResourceBundle>>
// and for efficiency, keep a hard reference to the bundle for the task
// locale
}
if (b == null) {
try {
} catch (MissingResourceException e) {
}
}
try {
} catch (MissingResourceException e) {
throw new InternalError(e, key);
}
}
//ResourceBundle bundle;
super(in);
}
int size() {
return size;
}
if (n > 0)
size += n;
return n;
}
int b = super.read();
size += 1;
return b;
}
private int size;
}
}