Summary: | Incorrect handling of large long values | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Emanuel Kupcik <ekupcik> | ||||
Component: | Core | Assignee: | Olivier Thomann <Olivier_Thomann> | ||||
Status: | CLOSED FIXED | QA Contact: | |||||
Severity: | blocker | ||||||
Priority: | P3 | CC: | philippe_mulet | ||||
Version: | 3.1 | ||||||
Target Milestone: | 3.1 RC2 | ||||||
Hardware: | All | ||||||
OS: | Windows 2000 | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Emanuel Kupcik
2005-05-30 05:16:34 EDT
Indeed we don't catch this case. Both javac and jikes are reporting a long value out of range. Philippe, this would be a candidate for RC2. Created attachment 21961 [details]
Proposed fix
With this patch, the test case is properly rejected.
+1 for RC2 Corresponding test case: public class X { public static void main(String[] args) { System.out.println(-9223372036854775809L); // KO System.out.println(9223372036854775809L); // KO System.out.println(9223372036854775808L); // KO System.out.println(23092395825689123986L); // KO System.out.println(-9223372036854775808L); // OK System.out.println(9223372036854775807L); // OK System.out.println(2309239582568912398L); // OK } } Fixed and released in HEAD. Regression test added in org.eclipse.jdt.core.tests.compiler.regression.ConstantTest.test013. Changes only in org.eclipse.jdt.internal.compiler.ast.LongLiteral. Verified in N20050606-0010 + JDT/Core HEAD. Verified for 3.1 RC2 using build I20050610-0010 |