Bug 47976 - Implementation of IField.getConstant() fails for some constants
Summary: Implementation of IField.getConstant() fails for some constants
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 2.1.3   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-12-03 09:20 EST by Robert Stupp CLA
Modified: 2004-03-01 12:00 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.