Eclipse - Debugging Issue about F5 [message #1773143] |
Fri, 22 September 2017 07:57 |
o o Messages: 1 Registered: September 2017 |
Junior Member |
|
|
F5 can not into method, unless each step is breakpoint.
Eclipse version 3.7, 4.5, 4.7
breakpoint 1 click F5 into breakpoint 2, F5 into breakpoint 3, F5 can not into step1(), unless step1() has breakpoint.
breakpoint 3 click F5 or F6 jumps directly to END
Code:
import org.junit.Test;
public class FrameworkTest {
public static void main(String[] args) {
Framework framework = Framework.getInstance(); // breakpoint 1
System.out.println(framework); // END
}
@Test
public void defaultFrameworkTest() {
Framework framework = Framework.getInstance();
System.out.println(framework);
}
}
public class Framework {
private static final Framework framework = new Framework();
private Framework(){
init(); // breakpoint 2
}
private void init() {
try {
step1(); // breakpoint 3
step2();
} catch (Exception e) {
throw new RuntimeException("Initialize framework fail.", e);
}
}
private void step1() {
System.out.println("step1");
}
private void step1() {
System.out.println("step2");
}
public static Framework getInstance() {
return framework;
}
}
|
|
|
Powered by
FUDForum. Page generated in 0.03109 seconds