开发者

Find out which exceptions a certaing class throws

开发者 https://www.devze.com 2023-02-17 05:47 出处:网络
When I click Ctrl+Q in IntelliJ, I do not get info on which exceptions a certain class throws. I can see this if I click Shift+F1 (view external docs) and开发者_如何学JAVA then browse the entire class

When I click Ctrl+Q in IntelliJ, I do not get info on which exceptions a certain class throws. I can see this if I click Shift+F1 (view external docs) and开发者_如何学JAVA then browse the entire class.

Is there any faster way to get this info in IntelliJ?


That's pulled from the javadoc (the @throws annotation) so if it's in the javadoc for a method and you highlight a method and press control-q if it throws any exceptions, it should show you.


I think there's no easier way since the exceptions are not thrown by the class, but by its methods.


You might want to try invoking Ctrl-Shift-F7 on the "throws" keyword in a method declaration. It shows the location(s) in the method body where that exception is thrown.

Not exactly what you asked for (I think), but might come in handy.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号