Community
Participate
Working Groups
int a = 0x0FFFFFFFF; On using the above line, the compiler built on BETA_JAVA7 reports " The literal 0x0FFFFFFFF of type int is out of range". Note that there are only 8F's and hence it should be a valid integer except they are some leading 0's. FYI, JDT/Core source code fails with this error when built with BETA_JAVA7 compiler. There are couple of references of 0x00000000FFFFFFFF.
I know the fix and will take care of this.
We need to remove all "0" between "0x" and the first non zero digits. This value is -1 and we have a special treatment for it.
Created attachment 189498 [details] Patch under consideration
Created attachment 189499 [details] Proposed fix + regression tests I wonder if we should not "clean" the literal ahead of time. This is a draft. I would need to clean the iteration on "0" inside the compute constant value code. Let me know what you think.
Created attachment 189504 [details] Proposed fix + regression tests This would be the cleanup version. It can then take advantage of using predefined constants when computing the value.
Created attachment 189509 [details] Proposed fix + regression tests I forgot to remove one comment in LongLiteral. We could prevent the string buffer creation by doing a second iteration over the literal when the modified flag is true.
Created attachment 189511 [details] Cleanup fix This patch only creates the string buffer if either '0' or '_' has to be removed.
Satyam, for fixes getting released only in a branch, the plan is to leave the milestone empty for the time being and to mention in white board contents that it is "Released in BETA_JAVA7 branch only"
Olivier, Your patch in comment 7 looks good and hence I have released it in the BETA_JAVA7 branch. Thank you.
Verified using Eclipse Java 7 Support(Beta) feature patch v20110623-0900.