CheckClassAdapter doesn't flush its output
The CheckClassAdapter has two small bugs. One, it does not use its PrintWriter
object to print the exception stack trace to -- it just prints to standard
error instead. Two, it does not flush its PrintWriter at the end of the
method, with the result being that the instructions it prints may be lost. (I
found this second one because the instructions were in fact being lost.)
Here is a diff showing the fixes required:
cd c:/ftp/asm-3.0/src/org/objectweb/asm/util/
diff -u "c:/ftp/asm-3.0/src/org/objectweb/asm/util/CheckClassAdapter.java.~1~"
"c:/ftp/asm-3.0/src/org/objectweb/asm/util/CheckClassAdapter.java"
--- c:/ftp/asm-3.0/src/org/objectweb/asm/util/CheckClassAdapter.java.~1~
2006-10-27 14:50:40.000000000 -0500
+++ c:/ftp/asm-3.0/src/org/objectweb/asm/util/CheckClassAdapter.java 2006-12-10
16:50:04.520881600 -0600
@@ -137,7 +137,7 @@
continue;
}
} catch (Exception e) {
- e.printStackTrace();
+ e.printStackTrace(pw);
}
Frame[] frames = a.getFrames();
@@ -174,6 +174,7 @@
}
pw.println();
}
+ pw.flush();
}
private static String getShortName(final String name) {
Diff finished at Mon Dec 11 21:51:35