Storyyeller / Krakatau

Java decompiler, assembler, and disassembler
GNU General Public License v3.0
1.95k stars 220 forks source link

DuplicateImport.java assertion error #17

Closed ysangkok closed 11 years ago

ysangkok commented 11 years ago

This test: http://hg.openjdk.java.net/jdk7/jdk7/langtools/file/tip/test/tools/javac/DuplicateImport.java

compiled with default settings on the JDK 1.7.0_21 javac,

Causes an assertion error in Krakatau:

% javac DuplicateImport.java                                                                                
% jar cf lol2.jar DuplicateImport.class                                                                               
% python /var/www/temp/Krakatau/decompile.py -path /usr/lib/jvm/java-7-oracle/jre/lib/rt.jar -out krakatau222 lol2.jar
Krakatau  Copyright (C) 2012-13  Robert Grosse
This program is provided as open source under the GNU General Public License. 
See LICENSE.TXT for more details.

Attempting to automatically locate the standard library...
Unable to find the standard library
processing target DuplicateImport, 1 remaining
Loading DuplicateImport
Traceback (most recent call last):
  File "/var/www/temp/Krakatau/decompile.py", line 126, in <module>
    decompileClass(path, targets, args.out)
  File "/var/www/temp/Krakatau/decompile.py", line 79, in decompileClass
    c = e.getClass(target)
  File "/var/www/temp/Krakatau/Krakatau/environment.py", line 25, in getClass
    result = self._loadClass(name, subclasses)
  File "/var/www/temp/Krakatau/Krakatau/environment.py", line 63, in _loadClass
    new.loadSupers(self, name, subclasses)
  File "/var/www/temp/Krakatau/Krakatau/classfile.py", line 94, in loadSupers
    assert(self.name == name)
AssertionError
Storyyeller commented 11 years ago

It sounds like you put the class in the wrong location in your jar. Are you able to execute it with Java?

It should have a more helpful error message, but there are a bunch of potentially user facing assertions that I never got around to changing.