diff --git a/plugins/IntentionPowerPak/src/com/siyeh/ipp/exceptions/ObscureThrownExceptionsPredicate.java b/plugins/IntentionPowerPak/src/com/siyeh/ipp/exceptions/ObscureThrownExceptionsPredicate.java index 4a98643cfd64..8f8987dc7a26 100644 --- a/plugins/IntentionPowerPak/src/com/siyeh/ipp/exceptions/ObscureThrownExceptionsPredicate.java +++ b/plugins/IntentionPowerPak/src/com/siyeh/ipp/exceptions/ObscureThrownExceptionsPredicate.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 Bas Leijdekkers + * Copyright 2011-2012 Bas Leijdekkers * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,16 +22,20 @@ import com.siyeh.ipp.base.PsiElementPredicate; class ObscureThrownExceptionsPredicate implements PsiElementPredicate { + @Override public boolean satisfiedBy(PsiElement element) { if (!(element instanceof PsiReferenceList)) { return false; } + final PsiReferenceList throwsList = (PsiReferenceList)element; + if (throwsList.getReferenceElements().length < 2) { + return false; + } final PsiElement parent = element.getParent(); if (!(parent instanceof PsiMethod)) { return false; } final PsiMethod method = (PsiMethod)parent; - final PsiReferenceList throwsList = method.getThrowsList(); - return throwsList.equals(element); + return method.getThrowsList().equals(element); } }