use of org.springsource.loaded.test.infra.ClassPrinter in project spring-loaded by spring-projects.
the class SpringLoadedTests method printItAndReturnIt.
protected String printItAndReturnIt(byte[] classdata, boolean quoted) {
OutputStream os = new SimpleOutputStream();
ClassReader reader = new ClassReader(classdata);
reader.accept(new ClassPrinter(new PrintStream(os)), 0);
StringBuffer sb = new StringBuffer(os.toString().replace("\r", ""));
if (!quoted) {
return sb.toString();
}
for (int i = 0; i < sb.length(); i++) {
if (sb.charAt(i) == '\n') {
sb.insert(i + 1, "\"");
sb.insert(i, "\\n\"+");
i += 4;
}
}
sb.delete(sb.length() - 3, sb.length());
sb.insert(0, "\"");
return sb.toString();
}
use of org.springsource.loaded.test.infra.ClassPrinter in project spring-loaded by spring-projects.
the class SpringLoadedTests method print.
protected void print(byte[] classdata) {
ClassReader reader = new ClassReader(classdata);
reader.accept(new ClassPrinter(System.out), 0);
}
Aggregations