今天发现一个Eclipse的Bug,原因可能是Eclipse.org没有正确实现JVM的规范所致。主要是在异常处理这里出的错误。它的输出和用JDK的输出有差入!
测试程序如下:
public final class ExceptionTest {
/**
* @param args
*/
public static void main(String[] args) {
try{
System.out.println("Begin thorw in outer try");
int i = 10 / 0;
System.out.println("Throw exception in outer end");
} catch(Exception e) {
e.printStackTrace();
System.out.println("End in outer try");
}
System.out.println("111");
}
}
Eclipse的输出为:
End in outer try
111
java.lang.ArithmeticException: / by zero
at ExceptionTest.main(ExceptionTest.java:10)
而JDK的输出为:
Begin thorw in outer try
java.lang.ArithmeticException: / by zero
at ExceptionTest.main(ExceptionTest.java:10)
End in outer try
111