Sample Program:
public class BugDemo4 {
static String BUGDEMO4;
public static void main(String argv[]) {
BugDemo4 bd, bugdemo;
bd = new BugDemo4("foo");
BUGDEMO4 = "bar";
}
public BugDemo4(String s) {
}
}
To illustrate this, enter the following commands in jdb:
load BugDemo4
stop in BugDemo4.main
run BugDemo4
next
dump BUGDEMO4
The dump command displays a BugDemo4 object, not the static String
BUGDEMO4.
Our Diagnosis
The print and dump commands call the RemoteDebugger.FindClass method to
see if
BUGDEMO4 is a class name, and apparently FindClass ignores case
distinctions.
This causes BUGDEMO4 to be printed (or dumped) as if it were the
BugDemo4
class.
This has been tried with the 1.1.2 Beta made available on 09apr97. It
still
fails.
public class BugDemo4 {
static String BUGDEMO4;
public static void main(String argv[]) {
BugDemo4 bd, bugdemo;
bd = new BugDemo4("foo");
BUGDEMO4 = "bar";
}
public BugDemo4(String s) {
}
}
To illustrate this, enter the following commands in jdb:
load BugDemo4
stop in BugDemo4.main
run BugDemo4
next
dump BUGDEMO4
The dump command displays a BugDemo4 object, not the static String
BUGDEMO4.
Our Diagnosis
The print and dump commands call the RemoteDebugger.FindClass method to
see if
BUGDEMO4 is a class name, and apparently FindClass ignores case
distinctions.
This causes BUGDEMO4 to be printed (or dumped) as if it were the
BugDemo4
class.
This has been tried with the 1.1.2 Beta made available on 09apr97. It
still
fails.
- duplicates
-
JDK-4042163 Class.forName() on Windows is case-insensitive (excluding zips)
- Closed