Eclipse的Bug

发现Eclipse存在一个Bug,可能是未正确实现JVM规范,主要体现在异常处理输出上与JDK有差异。文中给出测试程序,展示了Eclipse和JDK不同的输出结果。

      今天发现一个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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值