我有以下代码构造:
try {
//some code
}
catch(CustomException custExc) {
//log
}
catch(CustomException2 custExc2) {
//log
}
catch(Exception exc) {
//log
}
finally {
//some code
}
Run Code Online (Sandbox Code Playgroud)
我编写了单元测试:第一个是在没有抛出异常时执行的情况(仅执行try块代码,最后是块代码),另外3个是其中哪个是一次覆盖每个catch块(执行try块,catch之一)阻止,最后阻止).问题是Eclipse Emma插件显示我没有覆盖finally块.任何想法为什么会发生?