JDK-6891079 : Compiler allows invalid binary literals 0b and oBL
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 7
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2009-10-13
  • Updated: 2012-03-22
  • Resolved: 2012-01-13
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7 b75Fixed
Related Reports
Relates :  
Description
Compiler accepts the following invalid code:
public class Test {
    public static void main( String argv[] ) {
        int i = 0b;   // should be compile-time error
        long l = 0BL; // should be compile-time error
    }
}

according to grammar (http://ccc/6860965) this is invalid:
BinaryNumeral:
        0 b BinaryDigits
        0 B BinaryDigits
BinaryDigits:
        BinaryDigit
        BinaryDigit BinaryDigits
BinaryDigit: one of
        0 1

This test will be integrated into jck soon.

Comments
EVALUATION Yes, check is missing.
13-10-2009