-
Bug
-
Resolution: Fixed
-
P3
-
8
-
b103
-
Verified
When pretty printing a new array that has an initializer, the "[]" markers are printed twice:
if (tree.elemtype != null) {
...
if (tree.elems != null) {
...
print("[]");
}
...
}
if (tree.elems != null) {
if (tree.elemtype != null) print("[]");
...
}
Thus, a source file with "new Class[]{MethodType.class}" is printed as "new Class[][]{MethodType.class}".
I tried this with the latest promoted 8:
$ j8 -version
java version "1.8.0-ea"
Java(TM) SE Runtime Environment (build 1.8.0-ea-b90)
Java HotSpot(TM) 64-Bit Server VM (build 25.0-b32, mixed mode)
if (tree.elemtype != null) {
...
if (tree.elems != null) {
...
print("[]");
}
...
}
if (tree.elems != null) {
if (tree.elemtype != null) print("[]");
...
}
Thus, a source file with "new Class[]{MethodType.class}" is printed as "new Class[][]{MethodType.class}".
I tried this with the latest promoted 8:
$ j8 -version
java version "1.8.0-ea"
Java(TM) SE Runtime Environment (build 1.8.0-ea-b90)
Java HotSpot(TM) 64-Bit Server VM (build 25.0-b32, mixed mode)