sandalone
sandalone

Reputation: 41759

Find out which exceptions a certaing class throws

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 then browse the entire class.

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

Upvotes: 0

Views: 380

Answers (3)

Pakka Pakka
Pakka Pakka

Reputation: 2136

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.

Upvotes: 0

Robby Pond
Robby Pond

Reputation: 73494

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.

Upvotes: 1

Cristian
Cristian

Reputation: 200150

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

Upvotes: 1

Related Questions