1212import the .bytecode .club .bytecodeviewer .decompilers .InternalDecompiler ;
1313import the .bytecode .club .bytecodeviewer .gui .components .JFrameConsolePrintStream ;
1414import the .bytecode .club .bytecodeviewer .resources .ExternalResources ;
15+ import the .bytecode .club .bytecodeviewer .translation .TranslatedStrings ;
1516import the .bytecode .club .bytecodeviewer .util .MiscUtils ;
1617
1718import static the .bytecode .club .bytecodeviewer .Constants .fs ;
@@ -75,7 +76,6 @@ private synchronized String synchronizedDecompilation(ClassNode cn, byte[] b)
7576 //setup reflection
7677 Class <?> javap = child .loadClass ("com.sun.tools.javap.Main" );
7778 Method main = javap .getMethod ("main" , String [].class );
78- Object cl = javap .newInstance ();
7979
8080 //pipe sys out
8181 sysOutBuffer = new JFrameConsolePrintStream ("" , false );
@@ -84,13 +84,17 @@ private synchronized String synchronizedDecompilation(ClassNode cn, byte[] b)
8484 BytecodeViewer .sm .silenceExec (true );
8585
8686 //invoke Javap
87- main .invoke (cl , (Object ) new String []{
87+ main .invoke (null , (Object ) new String []{
8888 "-p" , //Shows all classes and members
8989 "-c" , //Prints out disassembled code
9090 //"-l", //Prints out line and local variable tables
9191 "-constants" , //Shows static final constants
9292 tempClass .getAbsolutePath ()});
9393 }
94+ catch (IllegalAccessException e )
95+ {
96+ return TranslatedStrings .ILLEGAL_ACCESS_ERROR .toString ();
97+ }
9498 catch (Exception e )
9599 {
96100 e .printStackTrace ();
0 commit comments