Are checked exceptions a bad idea?
checked异常是坏主意吗?
The difference is that in Groovy there are no checked exceptions.
区别在于,Groovy没有已检测的异常。
Will methods in the DAO's public interface throw checked exceptions?
DAO的公共接口中的方法是否抛出检查过的异常?
One problem with checked exceptions is that sometimes you simply aren't allowed to throw them.
checked异常的一个问题是,有时候不允许抛出这样的异常。
Methods in the DAO interface should throw checked exceptions only if the caller can reasonably be expected to handle the exception.
只有在可以合理地预期调用者可以处理异常时,DAO接口中的方法才应该抛出检查过的异常。
Reporter: C# doesn't have checked exceptions.
记者:C#没有受控异常。
I completely agree that checked exceptions are a wonderful feature.
我完全认同受控异常是很好的特性。
Reporter: I used to think that checked exceptions were really great.
记者:我过去真的认为受控异常是很好的想法。
Use checked exceptions to report errors that may occur, however rarely, under normal program operation.
使用需检查异常来报告可能发生但是在正常程序操作中很难发生的错误。
Unlike RMI, these services don't have checked exceptions (though clearly, if a communication error occurs, a RuntimeException will be thrown).
不像RMI那样,这些服务无需checked exception(很明显,如果发生了通信错误则会抛出RuntimeException)。
The ServiceLocator can also translate the checked exceptions (that get thrown during lookup or creation of the bean) into unchecked exceptions.
ServiceLocator还可以将检查的异常(在Bean查找或创建过程中引发的异常)转换为未经检查的异常。
First of all, not all checked exceptions are bad; they might be used for event notification or to redirect processing based on certain conditions.
首先,不是所有受控异常都是不好的;它们可用于事件通知或根据某些条件重定向处理。
Because checked exceptions are part of a method's signature, you can't add one to an overriding variant any more than you can change its return type.
因为checked异常是方法签名的一部分,在覆盖方法时,不能增加checked异常,就像不能改变return类型一样。
This article first discusses the expected behaviour on the client when the server throws various exceptions, and then emphasizes the use of checked exceptions.
本文首先讨论了当服务器抛出不同的异常时客户端的预期行为,然后强调了已检查的异常的使用。
For the method call instructions, you use Bytecode Engineering Library (BCEL) classes to extract the types of checked exceptions the method is declared to throw.
对于方法调用指令,可以使用BytecodeEngineeringLibrary (BCEL)类来提取方法声明抛出的已检查异常的类型。
For the method call instructions, you use Bytecode Engineering Library (BCEL) classes to extract the types of checked exceptions the method is declared to throw.
对于方法调用指令,可以使用BytecodeEngineeringLibrary (BCEL)类来提取方法声明抛出的已检查异常的类型。
应用推荐