// verify no warning if -Xlint:classfile not enabled
String out1 = compile( "-d", classesDir.getPath(), "-classpath", classesDir.getPath(),
d_java.getPath()); if (out1.length() > 0)
error("unexpected output from javac");
// sanity check of warning when -XDrawDiagnostics not used
String out2 = compile( "-d", classesDir.getPath(), "-classpath", classesDir.getPath(), "-Xlint:classfile",
d_java.getPath()); if (!out2.contains("[classfile]"))
error("expected output \"[classfile]\" not found");
// check specific details, using -XDrawDiagnostics
String out3 = compile( "-d", classesDir.getPath(), "-classpath", classesDir.getPath(), "-Xlint:classfile", "-XDrawDiagnostics",
d_java.getPath());
String expect = "C.class:-:-: compiler.warn.future.attr: Signature, 49, 0, 48, 0"; if (!out3.contains(expect))
error("expected output \"" + 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.