Bug 217910 - Parameter annotations should be displayed in front of each parameter in disassembled code
Summary: Parameter annotations should be displayed in front of each parameter in disas...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 3.4 M6   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-05 15:25 EST by Olivier Thomann CLA
Modified: 2008-03-26 12:40 EDT (History)
2 users (show)

See Also:


Attachments
Proposed fix (7.50 KB, patch)
2008-02-17 20:33 EST, Olivier Thomann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Olivier Thomann CLA 2008-02-05 15:25:04 EST
Right now the disassembler only shows the parameter annotations in SYSTEM mode as a separate attribute.

The following code:
import java.lang.annotation.Retention;
import static java.lang.annotation.RetentionPolicy.*;
@Retention(CLASS)
@interface X {
	int value() default -1;
}

is displayed using the SYSTEM mode as:
  // Method descriptor #15 (I)V
  // Stack: 0, Locals: 2
  public void foo(int i);
    0  return
      Line numbers:
        [pc: 0, line: 4]
      Local variable table:
        [pc: 0, pc: 1] local: this index: 0 type: X
        [pc: 0, pc: 1] local: i index: 1 type: int
    RuntimeVisibleParameterAnnotations: 
      Number of annotations for parameter 0: 1
        #21 @java.lang.Deprecated(
        )
    RuntimeInvisibleParameterAnnotations: 
      Number of annotations for parameter 0: 1
        #17 @Annot(
          #18 value=(int) 2 (constant type)
        )

is displayed using the DETAILED mode as:
  // Method descriptor #15 (I)V
  // Stack: 0, Locals: 2
  public void foo(int i);
    0  return
      Line numbers:
        [pc: 0, line: 4]
      Local variable table:
        [pc: 0, pc: 1] local: this index: 0 type: X
        [pc: 0, pc: 1] local: i index: 1 type: int

It would be nice to also be able to get the parameter annotation in DETAILED mode.
Comment 1 Olivier Thomann CLA 2008-02-17 17:57:37 EST
import java.lang.annotation.Retention;
import static java.lang.annotation.RetentionPolicy.*;
public class X {
	public void foo(@Deprecated @Zork @Annot(2) int i) {}
}
@Retention(CLASS)
@interface Annot {
	int value() default -1;
}
Comment 2 Olivier Thomann CLA 2008-02-17 20:33:51 EST
Created attachment 89949 [details]
Proposed fix
Comment 3 Olivier Thomann CLA 2008-02-17 21:42:59 EST
Released for 3.4M6.
Philippe, please verify that it meets your expectations.
Comment 4 Olivier Thomann CLA 2008-03-25 12:06:48 EDT
Added regression test org.eclipse.jdt.core.tests.compiler.regression.ClassFileReaderTest_1_5#test015
Comment 5 David Audel CLA 2008-03-26 12:40:32 EDT
Verified for 3.4M6 using build I20080325-2233