From 497ff23b93f6d1db1ccf8a78be4040e68cf1e385 Mon Sep 17 00:00:00 2001 From: "Anna.Kozlova" Date: Tue, 10 Oct 2017 19:15:28 +0200 Subject: [PATCH] reformat --- .../psi/impl/source/tree/java/PsiCatchSectionImpl.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/PsiCatchSectionImpl.java b/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/PsiCatchSectionImpl.java index da18515c6cc9..dfe8ae9dbd25 100644 --- a/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/PsiCatchSectionImpl.java +++ b/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/PsiCatchSectionImpl.java @@ -129,10 +129,11 @@ public class PsiCatchSectionImpl extends CompositePsiElement implements PsiCatch List types = new ArrayList<>(); for (PsiType type : uncaughtTypes) { if (declaredType.isAssignableFrom(type) || - // from 11.2.3 exception checking - // It is a compile-time error if a catch clause can catch checked exception class E1 and it is not the case that the try block corresponding to the catch clause can - // throw a checked exception class that is a subclass or superclass of E1, unless E1 is Exception or a superclass of Exception. - // so here unchecked exception can sneak throw Exception or Throwable catch type only + // JLS 11.2.3 "Exception Checking": + // "It is a compile-time error if a catch clause can catch checked exception class E1 and it is not the case + // that the try block corresponding to the catch clause can throw a checked exception class that is + // a subclass or superclass of E1, unless E1 is Exception or a superclass of Exception." + // So here unchecked exception can sneak through Exception or Throwable catch type only. ExceptionUtil.isGeneralExceptionType(declaredType) && type instanceof PsiClassType && ExceptionUtil.isUncheckedException((PsiClassType)type)) { types.add(type); }