invalid warning for Groovy methods that throw an exception

IDEA 8.0 gives me a "Not all execution paths return a value" warning on any Groovy method that throws an exception. For example:

int foo(int bar) {
if (bar == 0) throw new Exception()
return bar
}

This method generates the warning. Removing the first line makes the warning go away.

1 comment
Comment actions Permalink

Mark Smith wrote:

IDEA 8.0 gives me a "Not all execution paths return a value" warning on any Groovy method that throws an exception. For example:

int foo(int bar) {
if (bar == 0) throw new Exception()
return bar
}

This method generates the warning. Removing the first line makes the warning go away.

I've filed a JIRA issue: http://www.jetbrains.net/jira/browse/GRVY-1901
You may watch it to be notified on the progress

0

Please sign in to leave a comment.