When you print a field whose value is null, the error message says it is not a valid field. It *should* just report the value as null.
To use this test case, type the following:
javac -g WrongMessage.java
jdb WrongMessage
stop in WrongMessage.stop
run
print w.a
print w.b
---
For 'print w.a', you get:
w.a = this is a non-null string
For 'print w.b', you get:
"b" is not a valid field of (WrongMessage)0xee306998
This is wrong! You SHOULD get:
w.b = null
--- Here is the test case code:
public class WrongMessage
{
String a;
String b;
public static void main(String argv[])
{
WrongMessage w = new WrongMessage();
w.a = "this is a non-null string";
stop(w);
}
public static void stop(WrongMessage w)
{
System.out.println("w.a = "+w.a);
System.out.println("w.b = "+w.b);
}
}
To use this test case, type the following:
javac -g WrongMessage.java
jdb WrongMessage
stop in WrongMessage.stop
run
print w.a
print w.b
---
For 'print w.a', you get:
w.a = this is a non-null string
For 'print w.b', you get:
"b" is not a valid field of (WrongMessage)0xee306998
This is wrong! You SHOULD get:
w.b = null
--- Here is the test case code:
public class WrongMessage
{
String a;
String b;
public static void main(String argv[])
{
WrongMessage w = new WrongMessage();
w.a = "this is a non-null string";
stop(w);
}
public static void stop(WrongMessage w)
{
System.out.println("w.a = "+w.a);
System.out.println("w.b = "+w.b);
}
}