diff --git a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/structure/impl/JavaElementCollectionFromPsiArrayUtil.java b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/structure/impl/JavaElementCollectionFromPsiArrayUtil.java index b9e44d0cd10..0560cecb5bc 100644 --- a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/structure/impl/JavaElementCollectionFromPsiArrayUtil.java +++ b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/structure/impl/JavaElementCollectionFromPsiArrayUtil.java @@ -26,7 +26,6 @@ import java.util.Collection; import java.util.Collections; import java.util.List; -@SuppressWarnings("unchecked") public class JavaElementCollectionFromPsiArrayUtil { private JavaElementCollectionFromPsiArrayUtil() { } @@ -37,77 +36,75 @@ public class JavaElementCollectionFromPsiArrayUtil { } private static class Factories { - private static final Factory CLASSES = new Factory() { + private static final Factory CLASSES = new Factory() { @NotNull @Override - public JavaClassImpl create(@NotNull PsiClass psiClass) { + public JavaClass create(@NotNull PsiClass psiClass) { return new JavaClassImpl(psiClass); } }; - private static final Factory PACKAGES = new Factory() { + private static final Factory PACKAGES = new Factory() { @NotNull @Override - public JavaPackageImpl create(@NotNull PsiPackage psiPackage) { + public JavaPackage create(@NotNull PsiPackage psiPackage) { return new JavaPackageImpl(psiPackage); } }; - private static final Factory METHODS = new Factory() { + private static final Factory METHODS = new Factory() { @NotNull @Override - public JavaMethodImpl create(@NotNull PsiMethod psiMethod) { + public JavaMethod create(@NotNull PsiMethod psiMethod) { return new JavaMethodImpl(psiMethod); } }; - private static final Factory FIELDS = new Factory() { + private static final Factory FIELDS = new Factory() { @NotNull @Override - public JavaFieldImpl create(@NotNull PsiField psiField) { + public JavaField create(@NotNull PsiField psiField) { return new JavaFieldImpl(psiField); } }; - private static final Factory VALUE_PARAMETERS = - new Factory() { + private static final Factory VALUE_PARAMETERS = new Factory() { @NotNull @Override - public JavaValueParameterImpl create(@NotNull PsiParameter psiParameter) { + public JavaValueParameter create(@NotNull PsiParameter psiParameter) { return new JavaValueParameterImpl(psiParameter); } }; - private static final Factory TYPE_PARAMETERS = - new Factory() { + private static final Factory TYPE_PARAMETERS = + new Factory() { @NotNull @Override - public JavaTypeParameterImpl create(@NotNull PsiTypeParameter psiTypeParameter) { + public JavaTypeParameter create(@NotNull PsiTypeParameter psiTypeParameter) { return new JavaTypeParameterImpl(psiTypeParameter); } }; - private static final Factory> TYPES = new Factory>() { + private static final Factory TYPES = new Factory() { @NotNull @Override - public JavaTypeImpl create(@NotNull PsiType psiType) { + public JavaType create(@NotNull PsiType psiType) { return JavaTypeImpl.create(psiType); } }; - private static final Factory CLASSIFIER_TYPES = - new Factory() { + private static final Factory CLASSIFIER_TYPES = new Factory() { @NotNull @Override - public JavaClassifierTypeImpl create(@NotNull PsiClassType psiClassType) { + public JavaClassifierType create(@NotNull PsiClassType psiClassType) { return new JavaClassifierTypeImpl(psiClassType); } }; - private static final Factory ANNOTATIONS = new Factory() { + private static final Factory ANNOTATIONS = new Factory() { @NotNull @Override - public JavaAnnotationImpl create(@NotNull PsiAnnotation psiAnnotation) { + public JavaAnnotation create(@NotNull PsiAnnotation psiAnnotation) { return new JavaAnnotationImpl(psiAnnotation); } }; @@ -146,56 +143,56 @@ public class JavaElementCollectionFromPsiArrayUtil { @NotNull public static Collection classes(@NotNull PsiClass[] classes) { - return (Collection) convert(classes, Factories.CLASSES); + return convert(classes, Factories.CLASSES); } @NotNull public static Collection packages(@NotNull PsiPackage[] packages) { - return (Collection) convert(packages, Factories.PACKAGES); + return convert(packages, Factories.PACKAGES); } @NotNull public static Collection methods(@NotNull PsiMethod[] methods) { - return (Collection) convert(methods, Factories.METHODS); + return convert(methods, Factories.METHODS); } @NotNull public static Collection fields(@NotNull PsiField[] fields) { - return (Collection) convert(fields, Factories.FIELDS); + return convert(fields, Factories.FIELDS); } @NotNull public static List valueParameters(@NotNull PsiParameter[] parameters) { - return (List) convert(parameters, Factories.VALUE_PARAMETERS); + return convert(parameters, Factories.VALUE_PARAMETERS); } @NotNull public static List typeParameters(@NotNull PsiTypeParameter[] typeParameters) { - return (List) convert(typeParameters, Factories.TYPE_PARAMETERS); + return convert(typeParameters, Factories.TYPE_PARAMETERS); } @NotNull public static List types(@NotNull PsiType[] types) { - return (List) convert(types, Factories.TYPES); + return convert(types, Factories.TYPES); } @NotNull public static Collection classifierTypes(@NotNull PsiClassType[] classTypes) { - return (Collection) convert(classTypes, Factories.CLASSIFIER_TYPES); + return convert(classTypes, Factories.CLASSIFIER_TYPES); } @NotNull public static Collection annotations(@NotNull PsiAnnotation[] annotations) { - return (Collection) convert(annotations, Factories.ANNOTATIONS); + return convert(annotations, Factories.ANNOTATIONS); } @NotNull public static List namelessAnnotationArguments(@NotNull PsiAnnotationMemberValue[] memberValues) { - return (List) convert(memberValues, Factories.NAMELESS_ANNOTATION_ARGUMENTS); + return convert(memberValues, Factories.NAMELESS_ANNOTATION_ARGUMENTS); } @NotNull public static Collection namedAnnotationArguments(@NotNull PsiNameValuePair[] nameValuePairs) { - return (Collection) convert(nameValuePairs, Factories.NAMED_ANNOTATION_ARGUMENTS); + return convert(nameValuePairs, Factories.NAMED_ANNOTATION_ARGUMENTS); } }