publicvoid run() throws IOException {
String output = javap();
verify(output, "-public", "-protected", "-private"); // check that some of the options are listed
if (errors > 0) thrownew Error(errors + " found.");
}
String javap(String... args) {
StringWriter sw = new StringWriter();
PrintWriter out = new PrintWriter(sw); //sun.tools.javap.Main.entry(args); int rc = com.sun.tools.javap.Main.run(args, out); if (rc != (args.length == 0 ? 2 : 0)) thrownew Error("javap failed. rc=" + rc);
out.close(); return sw.toString();
}
void verify(String output, String... expects) { for (String expect: expects) { if (output.indexOf(expect)< 0)
error(expect + " not found");
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.