Cross Reference: BadBinaryLiterals.java
xref
: /
openjdk7
/
langtools
/
test
/
tools
/
javac
/
literals
/
BadBinaryLiterals.java
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
408
N/A
/*
408
N/A
* @test /nodynamiccopyright/
408
N/A
* @bug 6860965
408
N/A
* @summary Project Coin: binary literals
756
N/A
* @
compile
/
fail
/
ref
=BadBinaryLiterals.6.out -XDrawDiagnostics -source 6 -Xlint:-options
BadBinaryLiterals.java
408
N/A
* @
compile
/
fail
/
ref
=BadBinaryLiterals.7.out -XDrawDiagnostics
BadBinaryLiterals.java
408
N/A
*/
408
N/A
408
N/A
public
class
BadBinaryLiterals
{
408
N/A
int
valid
=
0
b0
;
// valid literal, illegal in source 6
408
N/A
int
baddigit
=
0
b012
;
// bad digit
408
N/A
//aaaabbbbccccddddeeeeffffgggghhhh
408
N/A
int
overflow1
=
0
b111111111111111111111111111111111
;
// too long for int
408
N/A
//aaaabbbbccccddddeeeeffffgggghhhhiiiijjjjkkkkllllmmmmnnnnoooopppp
408
N/A
int
overflow2
=
0
b11111111111111111111111111111111111111111111111111111111111111111L
;
// too long for long
408
N/A
float
badfloat1
=
0
b01
.
01
;
// no binary floats
408
N/A
float
badfloat2
=
0
b01e01
;
// no binary floats
408
N/A
}