public ByteCodeEngineSource decompile() throws IOException
{
final Map<String, String> classes = New.map();
final ByteCodeEngineLocation location = new ByteCodeEngineLocation( this.engine );
final Decompiler decompiler = new Decompiler();
decompiler.setOption( "style", "sun" );
decompiler.setOption( "tabwidth", "100" );
decompiler.setOption( "indent", "4" );
final ByteCodeEngineLocation engineLocation = location;
decompiler.setClassPath( new ClassPath( new ClassPath.Location[] { engineLocation,
ClassPath.createLocation( "reflection:" ) } ) );
for (String className : this.engine.getClassNamesAndBytes().keySet()) {
final StringWriter writer = new StringWriter();
decompiler.decompile( className, writer, null );
final String source = stripHeaderCommentFrom( writer.toString() );
classes.put( className, source );
}
return new ByteCodeEngineSourceImpl( classes );