Declared exception not being thrown highlighting

Hi there,

IDEA used to highlight the exceptions declared in the method signature that
were not thrown in the method's body. With 5181, that's not happening (at
least in my case).

Is this a bug, or is there a setting in the exceptions configurations that,
somehow, got changed (or a new one I haven't set, yet)?

Thx,
Andrei


5 comments

Hello Andrei,

That's always been the case for private methods only. Is your method marked
private?

-


Maxim Shafirov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

Hi there,

IDEA used to highlight the exceptions declared in the method signature
that were not thrown in the method's body. With 5181, that's not
happening (at least in my case).

Is this a bug, or is there a setting in the exceptions configurations
that, somehow, got changed (or a new one I haven't set, yet)?

Thx,
Andrei



0

Please check Settings|Errors|General|Unused throws.

--
regards,
--
Alexey Kudravtsev
Software Developer
JetBrains, Inc, http://www.jetbrains.com
"Develop with pleasure!"

"Andrei Oprea" <andrei.oprea@rogers.com> wrote in message
news:6f7635fad10e8c814a57b7d6bf2@news.intellij.net...

Hi there,

>

IDEA used to highlight the exceptions declared in the method signature
that were not thrown in the method's body. With 5181, that's not happening
(at least in my case).

>

Is this a bug, or is there a setting in the exceptions configurations
that, somehow, got changed (or a new one I haven't set, yet)?

>

Thx,
Andrei

>



0

Hi Maxim,

MS> That's always been the case for private methods only.
MS> Is your method marked private?

It doesn't matter what the modifier is, from what I can tell. Something like
the method below does not show any highlighting for the un-thrown exception.

private void test() throws TestException{
//
}

I tried it with 5.1 and I got the warning. In Demetra the warning does not
show up in any instance, so it looks like a bug if you haven't introduced
a new setting.

Regarding the behaviour (in 5.1, as a reference), why the "private" limitation?
If a method is not overridden, I think the warning should still appear (I
remember there was a similar thread for unused parameters in public methods).

Best,
Andrei


0

Hi Alexey,

AK> Please check Settings|Errors|General|Unused throws.
AK>

Aha, I see, thanks.

I was searching for "redundant" and "exception", none of them getting me
to that setting. You might want to standardize the names, the offline inspection
talks about "redundant" throws.

Best,
Andrei


0

Fixed.

--
regards,
--
Alexey Kudravtsev
Software Developer
JetBrains, Inc, http://www.jetbrains.com
"Develop with pleasure!"

"Andrei Oprea" <andrei.oprea@rogers.com> wrote in message
news:6f7635fad1388c814b0500e4cce@news.intellij.net...

Hi Alexey,

>

AK> Please check Settings|Errors|General|Unused throws.
AK>
Aha, I see, thanks.
I was searching for "redundant" and "exception", none of them getting me
to that setting. You might want to standardize the names, the offline
inspection talks about "redundant" throws.

>

Best,
Andrei

>



0

Please sign in to leave a comment.