void (PsiMethod method) { PsiClassType[] referencedTypes = method.getThrowsList().getReferencedTypes(); myTypeCodeFragments = new ArrayList<>(referencedTypes.length); myExceptionInfos = new ArrayList<>(referencedTypes.length); for (int i = 0; i < referencedTypes.length; i++) { CanonicalTypes.Type typeWrapper = CanonicalTypes.createTypeWrapper(referencedTypes[i]); final PsiTypeCodeFragment typeCodeFragment = createParameterTypeCodeFragment(typeWrapper.getTypeText(), method.getThrowsList()); typeWrapper.addImportsTo(typeCodeFragment); myTypeCodeFragments.add(typeCodeFragment); myExceptionInfos.add(new JavaThrownExceptionInfo(i, referencedTypes[i])); } }