public TypeExpression(final Project project, PsiType[] types) { final SmartTypePointerManager manager = SmartTypePointerManager.getInstance(project); myItems = new LinkedHashSet<SmartTypePointer>(); for (final PsiType type : types) { myItems.add(manager.createSmartTypePointer(type)); } }
@NotNull @Override protected InspectionGadgetsFix[] buildFixes(Object... infos) { final PsiElement context = (PsiElement) infos[1]; final SmartTypePointerManager pointerManager = SmartTypePointerManager.getInstance(context.getProject()); final List<PsiType> maskedTypes = (List<PsiType>) infos[0]; final List<InspectionGadgetsFix> fixes = new ArrayList<>(); for (PsiType thrown : maskedTypes) { final String typeText = thrown.getCanonicalText(); if (CommonClassNames.JAVA_LANG_RUNTIME_EXCEPTION.equals(typeText)) { fixes.add(new ReplaceWithRuntimeExceptionFix()); } else { fixes.add(new AddCatchSectionFix(pointerManager.createSmartTypePointer(thrown), typeText)); } } final InspectionGadgetsFix fix = SuppressForTestsScopeFix.build(this, context); if (fix != null) { fixes.add(fix); } return fixes.toArray(new InspectionGadgetsFix[fixes.size()]); }