- A Concurrent Affair - https://www.concurrentaffair.org -

Additional Java 5 Syntax Highlighting Errors in DrJava

While adding syntax highlighting for underscores and binary literals introduced in Java 7 [1] to DrJava [2], I discovered that a few other numbers aren’t syntax-highlighted correctly. Some of these problems go back to the beginning of Java, others go back to Java 5, when the obscure hexadecimal floating-point literal was introduced.

Here are the numbers that give DrJava’s syntax highlighter trouble:

[cc lang=”java”]float f = 6.022137e+23f;
f = 2.f;
f = .3f;

double d = 2.;
d = .3;
d = 1e-9d;

double x = 0x1.8p1;
x = 0x1.fffffffffffffp1023;
x = 0x1.0P-1074;
x = 0x0.0000000000001P-1022;[/cc]

Did you know about these hexadecimal floating-point literals? I didn’t.

I created a bug report for these Java 5 highlighting bugs [3].

References:

[8] [9]Share [10]