Bug 47976

Summary: Implementation of IField.getConstant() fails for some constants
Product: [Eclipse Project] JDT Reporter: Robert Stupp <rstupp>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.0   
Target Milestone: 2.1.3   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Robert Stupp CLA 2003-12-03 09:20:42 EST
Given is the following piece of code in a Java Source:
--------------------------------------------
public class Test {
    static final long serialVersionUID=938245798324893L;
}
--------------------------------------------

When inquiring the constant value through IField.getConstant(), a
NumberFormatException is thrown, because Long.parseLong("938245798324893L") does
not allow the 'L' character - same issue for "938245798324893l".

Stack trace:
   ...
   at java.lang.NumberFormatException.forInputString...
   at java.lang.Long.parseLong...
   at java.lang.Long.<init>...
   at org.eclipse.jdt.internal.core.SourceField.getConstant(SourceField:69)
   ...


I'm using Eclipse build 200311211210 (3.0M5)
Comment 1 Olivier Thomann CLA 2003-12-03 10:28:53 EST
I am investigating.
Comment 2 Olivier Thomann CLA 2003-12-03 10:49:05 EST
Fixed and released in HEAD.
Regression test added.
Comment 3 Olivier Thomann CLA 2003-12-04 11:46:01 EST
Backported to 2.1.3
Comment 4 David Audel CLA 2003-12-17 07:27:16 EST
Verified for 3.0M6
Comment 5 Frederic Fusier CLA 2004-03-01 12:00:29 EST
Verified for 2.1.3 with build M200402251535.