Bug 286405 - Default value character of annotations in ClassFileEditor are badly printed
Summary: Default value character of annotations in ClassFileEditor are badly printed
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P3 minor (vote)
Target Milestone: 3.6 M2   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-12 12:04 EDT by Romain Dervaux CLA
Modified: 2009-09-15 11:41 EDT (History)
1 user (show)

See Also:


Attachments
Proposed fix (7.71 KB, patch)
2009-08-12 12:33 EDT, 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 Romain Dervaux CLA 2009-08-12 12:04:44 EDT
Build ID: 20090619-0625

Steps To Reproduce:
1. Create .class file of this annotation : 
public @interface MonAnnotation {
	
	String test1() default "\0";
	char test2() default '\0';
}

2. Open the class file in the ClassFileEditor.
3. default value of test1() will be printed normally. default value of test2() will not, probably because the character has not been escaped.


More information:
Comment 1 Olivier Thomann CLA 2009-08-12 12:20:07 EDT
Reproduced.
We print:
  // Method descriptor #8 ()Ljava/lang/String;
  public abstract String test1();
    Annotation Default: 
      "\0" (constant type)
  
  // Method descriptor #12 ()C
  public abstract char test2();
    Annotation Default: 
      ' ' (constant type)
}
Instead of '\0'.
Will fix for 3.6M2. No need to backport for 3.5.1.
Comment 2 Olivier Thomann CLA 2009-08-12 12:33:24 EDT
Created attachment 144258 [details]
Proposed fix
Comment 3 Olivier Thomann CLA 2009-08-12 21:28:01 EDT
Released for 3.6M2.
Regression test added in:
org.eclipse.jdt.core.tests.compiler.regression.ClassFileReaderTest_1_5#test016
Comment 4 Kent Johnson CLA 2009-09-15 11:41:20 EDT
Verified for 3.6M2