Bug 111219

Summary: Disassembler generates syntactically incorrect code
Product: [Eclipse Project] JDT Reporter: Jerome Lanneluc <jerome_lanneluc>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.2 M3   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 110160    

Description Jerome Lanneluc CLA 2005-09-30 11:33:42 EDT
I20050928

If you disassemble code in a non-default package, the name of the package is
prepend to the name of the class. E.g. this is what you get for java.lang.Double:

public final class java.lang.Double extends java.lang.Number implements
java.lang.Comparable {
  
  public static final double POSITIVE_INFINITY = Infinity;

[...]
Comment 1 Jerome Lanneluc CLA 2005-09-30 11:34:53 EDT
Also note that the constant 'Infinity' is suspicious.
Comment 2 Jerome Lanneluc CLA 2005-09-30 11:35:38 EDT
Olivier, can you please have a look at this ? This is needed for bug 110160.
Comment 3 Olivier Thomann CLA 2005-09-30 12:29:27 EDT
I will investigate.
Comment 4 Olivier Thomann CLA 2005-09-30 12:30:07 EDT
So you would expect:
package java.lang;

public final class Double extends java.lang.Number implements
java.lang.Comparable {
....

I'll check what I can do for the Infinity constant.
Comment 5 Jerome Lanneluc CLA 2005-09-30 12:35:20 EDT
(In reply to comment #4)
> So you would expect:
> package java.lang;
> 
> public final class Double extends java.lang.Number implements
> java.lang.Comparable {
> ....
> 
Correct
Comment 6 Olivier Thomann CLA 2005-09-30 21:35:49 EDT
Fixed and released in HEAD.
Added regression test
org.eclipse.jdt.core.tests.compiler.regression.ClassFileReaderTest.test072/test074.
Use the new mode
org.eclipse.jdt.core.util.ClassFileBytesDisassembler.WORKING_COPY to get the
output that you want.
Comment 7 Frederic Fusier CLA 2005-10-31 03:06:35 EST
Verified for 3.2 M3 using ASTView and build I20051025-0800+v_619