Name: ccC48265 Date: 12/12/97
Breakpoint hit: foo.main (foo:3)
main[1] list
1 public class Foo {
2 static public void main(String argv[]) {
3 => Foo[] f = new Foo[3];
4 }
5 }
main[1] next
main[1]
Breakpoint hit: foo.main (foo:2)
main[1] print f
f = { null, null, null }
main[1] print f.length
"length" is not a valid field of { null, null, null }
main[1]
----- TEST CASE ----->
Put this code (minus the line numbers, of course) into a file called
Foo.java.
1 public class Foo {
2 static public void main(String argv[]) {
3 => Foo[] f = new Foo[3];
4 }
5 }
Compile it using "javac -g Foo.java".
Run it using "jdb Foo"
Say "stop in foo.main". Type "run". Type "next". Type "print f".
Type "print f.length".
(Review ID: 21817)
=======================================================================
###@###.### (Dec 12, 1997):
Using JDK1.2beta2(Y), I was able to reproduce this bug. I also tried
replacing the line `Foo[] f = new Foo[3];' with `int[] i = {1,2,3};' and
(as expected) I got a similar error message:
main[1] print i.length
"length" is not a valid field of { 1, 2, 3 }
======================================================================
- relates to
-
JDK-4422141 TTY: .length field for arrays in print statements in jdb not recognized
-
- Resolved
-