#218 NumberFormatException parsing long value

release_3.3
closed
Rick Giles
5
2012-10-10
2004-03-09
tgourley
No

If the value:
long mylong = 0xfffffffffffffc00L;
is encountered in a java source file the ant task reports
this:

[checkstyle]
G:\base\mti\fms\FMSServerCache\testsrc\com\edsplm\fm
s\servercache\FMSServerCacheTest.java:0: Got an
excepti
on - java.lang.NumberFormatException: For input
string: "fffffffffffffc00"

The Eclipse plugin shows the same problem, I'm guessing
it is a core parser problem.

In this case using ~0x3ffL is a workaround.

Discussion

  • Rick Giles
    Rick Giles
    2004-03-09

    Logged In: YES
    user_id=539926

    We need information about the check that caused the error.
    If the check is the MagicNumberCheck, the problem is fixed
    in the current (3.4) CVS and this report should be closed.
    If it is another check, please re-open this report and
    indicate the check.

     
  • tgourley
    tgourley
    2004-03-10

    Logged In: YES
    user_id=994196

    You are correct, it was the MagicNumberCheck. I was unable
    to get a full stack trace but turning off that check makes the
    problem go away. (I've only been playing with it for a day
    now) Sorry about the duplicate, and Thanks for the help!