fix parenthesis expr during precise rethrow detection

This commit is contained in:
Anna.Kozlova
2016-04-04 21:24:28 +02:00
parent 2b8ed56db0
commit 5f73492b7f
2 changed files with 10 additions and 1 deletions
@@ -579,7 +579,8 @@ public class ExceptionUtil {
}
@NotNull
private static List<PsiType> getPreciseThrowTypes(@Nullable final PsiExpression expression) {
private static List<PsiType> getPreciseThrowTypes(@Nullable PsiExpression expression) {
expression = PsiUtil.skipParenthesizedExprDown(expression);
if (expression instanceof PsiReferenceExpression) {
final PsiElement target = ((PsiReferenceExpression)expression).resolve();
if (target != null && PsiUtil.isCatchParameter(target)) {
@@ -193,6 +193,14 @@ class C {
}
}
void m11_5() {
try {}
catch (Exception e) {
//parentesis expr
throw (e);
}
}
static class MyResource implements AutoCloseable {
public void close() throws E1 { }
}