When stepping over a native method which calls a Java method, the step never completes and the application runs to completion (or to the next event). This can be seen in JDK 1.2.2 with the following debuggee:
package untitled5;
public class untitled5 {
public static void main(String[] args) {
String xyz = "abc";
Object obj = xyz;
Class clazz = obj.getClass();
//String toString = clazz.toString(); // uncomment this line if you want to avoid the problem
String clazzName = clazz.getName(); // put breakpoint here, and step-over
int shouldbeHere = 0; // it should have stopped here !!
if (shouldbeHere >= 0) {
System.out.println("abc");
}
}
}
Class.getName is a native method which, on its first call, will call a java method (String constructor). When stepping over the call in the example above, the app runs to completion. Note that getName() only calls a java method on its first invocation under 1.2.2. Under 1.3, this particular test case doesn't fail, but it should be easy to construct another that will, since the code in this area is unchanged.
package untitled5;
public class untitled5 {
public static void main(String[] args) {
String xyz = "abc";
Object obj = xyz;
Class clazz = obj.getClass();
//String toString = clazz.toString(); // uncomment this line if you want to avoid the problem
String clazzName = clazz.getName(); // put breakpoint here, and step-over
int shouldbeHere = 0; // it should have stopped here !!
if (shouldbeHere >= 0) {
System.out.println("abc");
}
}
}
Class.getName is a native method which, on its first call, will call a java method (String constructor). When stepping over the call in the example above, the app runs to completion. Note that getName() only calls a java method on its first invocation under 1.2.2. Under 1.3, this particular test case doesn't fail, but it should be easy to construct another that will, since the code in this area is unchanged.
- relates to
-
JDK-4342204 unix: regression test StepTest fails
-
- Closed
-