diff --git a/compiler/frontend.java/src/org/jetbrains/kotlin/load/java/structure/impl/JavaClassImpl.java b/compiler/frontend.java/src/org/jetbrains/kotlin/load/java/structure/impl/JavaClassImpl.java index 29220f87a25..638aadc2dc0 100644 --- a/compiler/frontend.java/src/org/jetbrains/kotlin/load/java/structure/impl/JavaClassImpl.java +++ b/compiler/frontend.java/src/org/jetbrains/kotlin/load/java/structure/impl/JavaClassImpl.java @@ -17,7 +17,6 @@ package org.jetbrains.kotlin.load.java.structure.impl; import com.intellij.psi.*; -import com.intellij.psi.impl.PsiSubstitutorImpl; import kotlin.collections.ArraysKt; import kotlin.jvm.functions.Function1; import org.jetbrains.annotations.NotNull; @@ -29,9 +28,7 @@ import org.jetbrains.kotlin.name.FqName; import org.jetbrains.kotlin.name.Name; import java.util.Collection; -import java.util.HashMap; import java.util.List; -import java.util.Map; import static org.jetbrains.kotlin.load.java.structure.impl.JavaElementCollectionFromPsiArrayUtil.*; @@ -169,27 +166,6 @@ public class JavaClassImpl extends JavaClassifierImpl implements JavaC } } - @NotNull - /* package */ JavaTypeImpl createImmediateType(@NotNull Map> substitutionMap) { - return new JavaClassifierTypeImpl( - JavaPsiFacade.getElementFactory(getPsi().getProject()).createType(getPsi(), createPsiSubstitutor(substitutionMap)) - ); - } - - @NotNull - private static PsiSubstitutor createPsiSubstitutor(@NotNull Map> substitutionMap) { - if (substitutionMap.isEmpty()) return PsiSubstitutor.EMPTY; - - Map result = new HashMap(); - for (Map.Entry> entry : substitutionMap.entrySet()) { - PsiTypeParameter key = entry.getKey().getPsi(); - JavaTypeImpl value = entry.getValue(); - result.put(key, value == null ? null : value.getPsi()); - } - - return PsiSubstitutorImpl.createSubstitutor(result); - } - @Nullable @Override public PsiAnnotationOwner getAnnotationOwnerPsi() { diff --git a/compiler/frontend.java/src/org/jetbrains/kotlin/load/java/structure/impl/JavaClassifierTypeImpl.java b/compiler/frontend.java/src/org/jetbrains/kotlin/load/java/structure/impl/JavaClassifierTypeImpl.java index 92fa4f62d79..c5ab1cb7736 100644 --- a/compiler/frontend.java/src/org/jetbrains/kotlin/load/java/structure/impl/JavaClassifierTypeImpl.java +++ b/compiler/frontend.java/src/org/jetbrains/kotlin/load/java/structure/impl/JavaClassifierTypeImpl.java @@ -22,15 +22,17 @@ import org.jetbrains.annotations.Nullable; import org.jetbrains.kotlin.load.java.structure.JavaClassifierType; import org.jetbrains.kotlin.load.java.structure.JavaType; -import java.util.*; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; public class JavaClassifierTypeImpl extends JavaTypeImpl implements JavaClassifierType { private static class ResolutionResult { private final JavaClassifierImpl classifier; - private final JavaTypeSubstitutorImpl substitutor; + private final PsiSubstitutor substitutor; private final boolean isRaw; - private ResolutionResult(@Nullable JavaClassifierImpl classifier, @NotNull JavaTypeSubstitutorImpl substitutor, boolean isRaw) { + private ResolutionResult(@Nullable JavaClassifierImpl classifier, @NotNull PsiSubstitutor substitutor, boolean isRaw) { this.classifier = classifier; this.substitutor = substitutor; this.isRaw = isRaw; @@ -51,7 +53,7 @@ public class JavaClassifierTypeImpl extends JavaTypeImpl implement } @NotNull - public JavaTypeSubstitutorImpl getSubstitutor() { + public PsiSubstitutor getSubstitutor() { resolve(); return resolutionResult.substitutor; } @@ -62,26 +64,11 @@ public class JavaClassifierTypeImpl extends JavaTypeImpl implement PsiClass psiClass = result.getElement(); PsiSubstitutor substitutor = result.getSubstitutor(); resolutionResult = new ResolutionResult( - psiClass == null ? null : JavaClassifierImpl.create(psiClass), - new JavaTypeSubstitutorImpl(convertSubstitutionMap(substitutor.getSubstitutionMap())), - PsiClassType.isRaw(result) + psiClass == null ? null : JavaClassifierImpl.create(psiClass), substitutor, PsiClassType.isRaw(result) ); } } - @NotNull - private static Map> convertSubstitutionMap(@NotNull Map psiMap) { - if (psiMap.isEmpty()) return Collections.emptyMap(); - - Map> result = new HashMap>(); - for (Map.Entry entry : psiMap.entrySet()) { - PsiType value = entry.getValue(); - result.put(new JavaTypeParameterImpl(entry.getKey()), value == null ? null : JavaTypeImpl.create(value)); - } - - return result; - } - @Override @NotNull public String getPresentableText() { @@ -98,17 +85,17 @@ public class JavaClassifierTypeImpl extends JavaTypeImpl implement @NotNull public List getTypeArguments() { JavaClassifierImpl classifier = getClassifier(); + if (!(classifier instanceof JavaClassImpl)) return Collections.emptyList(); // parameters including ones from outer class - Iterable parameters = classifier instanceof JavaClassImpl - ? getTypeParameters(classifier.getPsi()) - : Collections.emptyList(); + List parameters = getTypeParameters(classifier.getPsi()); - JavaTypeSubstitutorImpl substitutor = getSubstitutor(); + PsiSubstitutor substitutor = getSubstitutor(); - List result = new ArrayList(); + List result = new ArrayList(parameters.size()); for (PsiTypeParameter typeParameter : parameters) { - result.add(substitutor.substitute(new JavaTypeParameterImpl(typeParameter))); + PsiType substitutedType = substitutor.substitute(typeParameter); + result.add(substitutedType == null ? null : JavaTypeImpl.create(substitutedType)); } return result; @@ -124,7 +111,7 @@ public class JavaClassifierTypeImpl extends JavaTypeImpl implement // PsiUtil.typeParametersIterable returns H3, H2, H1 // But we would like to have H2, H3, H1 as such order is consistent with our type representation @NotNull - public static List getTypeParameters(@NotNull PsiClass owner) { + private static List getTypeParameters(@NotNull PsiClass owner) { List result = null; PsiTypeParameterListOwner currentOwner = owner; diff --git a/compiler/frontend.java/src/org/jetbrains/kotlin/load/java/structure/impl/JavaElementCollectionFromPsiArrayUtil.java b/compiler/frontend.java/src/org/jetbrains/kotlin/load/java/structure/impl/JavaElementCollectionFromPsiArrayUtil.java index 9eb37dc484f..70cf677a171 100644 --- a/compiler/frontend.java/src/org/jetbrains/kotlin/load/java/structure/impl/JavaElementCollectionFromPsiArrayUtil.java +++ b/compiler/frontend.java/src/org/jetbrains/kotlin/load/java/structure/impl/JavaElementCollectionFromPsiArrayUtil.java @@ -88,14 +88,6 @@ public class JavaElementCollectionFromPsiArrayUtil { } }; - private static final Factory TYPES = new Factory() { - @NotNull - @Override - public JavaType create(@NotNull PsiType psiType) { - return JavaTypeImpl.create(psiType); - } - }; - private static final Factory CLASSIFIER_TYPES = new Factory() { @NotNull @Override @@ -192,11 +184,6 @@ public class JavaElementCollectionFromPsiArrayUtil { return convert(typeParameters, Factories.TYPE_PARAMETERS); } - @NotNull - public static List types(@NotNull PsiType[] types) { - return convert(types, Factories.TYPES); - } - @NotNull public static Collection classifierTypes(@NotNull PsiClassType[] classTypes) { return convert(classTypes, Factories.CLASSIFIER_TYPES); diff --git a/compiler/frontend.java/src/org/jetbrains/kotlin/load/java/structure/impl/JavaTypeSubstitutorImpl.java b/compiler/frontend.java/src/org/jetbrains/kotlin/load/java/structure/impl/JavaTypeSubstitutorImpl.java deleted file mode 100644 index 5d6a15db01e..00000000000 --- a/compiler/frontend.java/src/org/jetbrains/kotlin/load/java/structure/impl/JavaTypeSubstitutorImpl.java +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Copyright 2010-2015 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.kotlin.load.java.structure.impl; - -import com.intellij.psi.*; -import com.intellij.psi.search.GlobalSearchScope; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.kotlin.load.java.structure.JavaClassifier; -import org.jetbrains.kotlin.load.java.structure.JavaClassifierType; -import org.jetbrains.kotlin.load.java.structure.JavaPrimitiveType; - -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class JavaTypeSubstitutorImpl { - private final Map> substitutionMap; - - public JavaTypeSubstitutorImpl(@NotNull Map> substitutionMap) { - this.substitutionMap = substitutionMap; - } - - @NotNull - public JavaTypeImpl substitute(@NotNull JavaTypeImpl type) { - JavaTypeImpl substitutedType = substituteInternal(type); - return substitutedType != null ? substitutedType : correctSubstitutionForRawType(type); - } - - @NotNull - // In case of raw type we get substitution map like T -> null, - // in this case we should substitute upper bound of T or, - // if it does not exist, return java.lang.Object - private JavaTypeImpl correctSubstitutionForRawType(@NotNull JavaTypeImpl original) { - if (original instanceof JavaClassifierType) { - JavaClassifier classifier = ((JavaClassifierType) original).getClassifier(); - if (classifier instanceof JavaTypeParameterImpl) { - return rawTypeForTypeParameter((JavaTypeParameterImpl) classifier); - } - } - - return original; - } - - @Nullable - private JavaTypeImpl substituteInternal(@NotNull JavaTypeImpl type) { - if (type instanceof JavaClassifierTypeImpl) { - JavaClassifierTypeImpl classifierType = (JavaClassifierTypeImpl) type; - JavaClassifierImpl classifier = classifierType.getClassifier(); - - if (classifier instanceof JavaTypeParameterImpl) { - return substitute((JavaTypeParameterImpl) classifier); - } - else if (classifier instanceof JavaClassImpl) { - JavaClassImpl javaClass = (JavaClassImpl) classifier; - Map> substMap = new HashMap>(); - processClass(javaClass, classifierType.getSubstitutor(), substMap); - - return javaClass.createImmediateType(substMap); - } - - return type; - } - else if (type instanceof JavaPrimitiveType) { - return type; - } - else if (type instanceof JavaArrayTypeImpl) { - JavaTypeImpl componentType = ((JavaArrayTypeImpl) type).getComponentType(); - JavaTypeImpl substitutedComponentType = substitute(componentType); - if (substitutedComponentType == componentType) return type; - - return new JavaArrayTypeImpl(substitutedComponentType.getPsi().createArrayType()); - } - else if (type instanceof JavaWildcardTypeImpl) { - return substituteWildcardType((JavaWildcardTypeImpl) type); - } - - return type; - } - - private void processClass( - @NotNull JavaClassImpl javaClass, - @NotNull JavaTypeSubstitutorImpl substitutor, - @NotNull Map> substMap - ) { - @SuppressWarnings("unchecked") - List typeParameters = (List) javaClass.getTypeParameters(); - for (JavaTypeParameterImpl typeParameter : typeParameters) { - JavaTypeImpl substitutedParam = substitutor.substitute(typeParameter); - substMap.put(typeParameter, substitutedParam == null ? null : substituteInternal(substitutedParam)); - } - - if (javaClass.isStatic()) { - return; - } - - JavaClassImpl outerClass = javaClass.getOuterClass(); - if (outerClass != null) { - processClass(outerClass, substitutor, substMap); - } - } - - @Nullable - private JavaTypeImpl substituteWildcardType(@NotNull JavaWildcardTypeImpl wildcardType) { - JavaTypeImpl bound = wildcardType.getBound(); - if (bound == null) { - return wildcardType; - } - - JavaTypeImpl newBound = substituteInternal(bound); - if (newBound == null) { - // This can be in case of substitution wildcard to raw type - return null; - } - - return rebound(wildcardType, newBound); - } - - @NotNull - private static JavaWildcardTypeImpl rebound(@NotNull JavaWildcardTypeImpl type, @NotNull JavaTypeImpl newBound) { - PsiManager manager = type.getPsi().getManager(); - if (createJavaLangObjectType(manager).equals(newBound)) { - return createUnboundedWildcard(manager); - } - - if (type.isExtends()) { - return createUpperBoundWildcard(manager, newBound); - } - else { - return createLowerBoundWildcard(manager, newBound); - } - } - - @NotNull - private JavaTypeImpl rawTypeForTypeParameter(@NotNull JavaTypeParameterImpl typeParameter) { - Collection bounds = typeParameter.getUpperBounds(); - if (!bounds.isEmpty()) { - return substitute(((JavaClassifierTypeImpl) bounds.iterator().next())); - } - - return createJavaLangObjectType(typeParameter.getPsi().getManager()); - } - - @Nullable - public JavaTypeImpl substitute(@NotNull JavaTypeParameterImpl typeParameter) { - if (substitutionMap.containsKey(typeParameter)) { - return substitutionMap.get(typeParameter); - } - - PsiTypeParameter psiTypeParameter = typeParameter.getPsi(); - return JavaTypeImpl.create( - JavaPsiFacade.getInstance(psiTypeParameter.getProject()).getElementFactory().createType(psiTypeParameter) - ); - } - - @Override - public int hashCode() { - return substitutionMap.hashCode(); - } - - @Override - public boolean equals(Object obj) { - return obj instanceof JavaTypeSubstitutorImpl && substitutionMap.equals(((JavaTypeSubstitutorImpl) obj).substitutionMap); - } - - @Override - public String toString() { - return getClass().getSimpleName() + ": " + substitutionMap; - } - - @NotNull - private static JavaTypeImpl createJavaLangObjectType(@NotNull PsiManager manager) { - return JavaTypeImpl.create(PsiType.getJavaLangObject(manager, GlobalSearchScope.allScope(manager.getProject()))); - } - - @NotNull - private static JavaWildcardTypeImpl createUpperBoundWildcard(@NotNull PsiManager manager, @NotNull JavaTypeImpl bound) { - return new JavaWildcardTypeImpl(PsiWildcardType.createExtends(manager, bound.getPsi())); - } - - @NotNull - private static JavaWildcardTypeImpl createLowerBoundWildcard(@NotNull PsiManager manager, @NotNull JavaTypeImpl bound) { - return new JavaWildcardTypeImpl(PsiWildcardType.createSuper(manager, bound.getPsi())); - } - - @NotNull - private static JavaWildcardTypeImpl createUnboundedWildcard(@NotNull PsiManager manager) { - return new JavaWildcardTypeImpl(PsiWildcardType.createUnbounded(manager)); - } -} diff --git a/generators/src/org/jetbrains/kotlin/generators/tests/GenerateTests.kt b/generators/src/org/jetbrains/kotlin/generators/tests/GenerateTests.kt index 072fb84f984..f65ac1ce7f0 100644 --- a/generators/src/org/jetbrains/kotlin/generators/tests/GenerateTests.kt +++ b/generators/src/org/jetbrains/kotlin/generators/tests/GenerateTests.kt @@ -119,7 +119,6 @@ import org.jetbrains.kotlin.jvm.runtime.AbstractJvmRuntimeDescriptorLoaderTest import org.jetbrains.kotlin.lang.resolve.android.test.AbstractAndroidBoxTest import org.jetbrains.kotlin.lang.resolve.android.test.AbstractAndroidBytecodeShapeTest import org.jetbrains.kotlin.lang.resolve.android.test.AbstractAndroidSyntheticPropertyDescriptorTest -import org.jetbrains.kotlin.load.java.AbstractJavaTypeSubstitutorTest import org.jetbrains.kotlin.modules.xml.AbstractModuleXmlParserTest import org.jetbrains.kotlin.parsing.AbstractParsingTest import org.jetbrains.kotlin.psi.patternMatching.AbstractPsiUnifierTest @@ -359,11 +358,6 @@ fun main(args: Array) { testGroup("idea/tests", "idea/testData") { - - testClass() { - model("typeSubstitution", extension = "java") - } - testClass() { model("resolve/additionalLazyResolve") } diff --git a/idea/testData/typeSubstitution/arrayType.java b/idea/testData/typeSubstitution/arrayType.java deleted file mode 100644 index 63c786d0e79..00000000000 --- a/idea/testData/typeSubstitution/arrayType.java +++ /dev/null @@ -1,8 +0,0 @@ -interface arrayType { - interface SuperArray { - T[] typeForSubstitute(); - } - - interface MidArray extends SuperArray { - } -} \ No newline at end of file diff --git a/idea/testData/typeSubstitution/classType.java b/idea/testData/typeSubstitution/classType.java deleted file mode 100644 index 57fd4b9587d..00000000000 --- a/idea/testData/typeSubstitution/classType.java +++ /dev/null @@ -1,8 +0,0 @@ -interface classType { - interface SuperClass { - List typeForSubstitute(); - } - - interface MidClass extends SuperClass { - } -} \ No newline at end of file diff --git a/idea/testData/typeSubstitution/classWithWildcard.java b/idea/testData/typeSubstitution/classWithWildcard.java deleted file mode 100644 index 68e6a144c43..00000000000 --- a/idea/testData/typeSubstitution/classWithWildcard.java +++ /dev/null @@ -1,10 +0,0 @@ -import java.util.*; - -interface classWithWildcard { - interface SuperList { - List typeForSubstitute(); - } - - interface MidList extends SuperList> { - } -} \ No newline at end of file diff --git a/idea/testData/typeSubstitution/genericArray.java b/idea/testData/typeSubstitution/genericArray.java deleted file mode 100644 index 6840d9b0f05..00000000000 --- a/idea/testData/typeSubstitution/genericArray.java +++ /dev/null @@ -1,8 +0,0 @@ -interface genericArray { - interface SuperGenericArray { - T typeForSubstitute(); - } - - interface MidGenericArray extends SuperGenericArray { - } -} \ No newline at end of file diff --git a/idea/testData/typeSubstitution/innerParameter.java b/idea/testData/typeSubstitution/innerParameter.java deleted file mode 100644 index bd9050093ed..00000000000 --- a/idea/testData/typeSubstitution/innerParameter.java +++ /dev/null @@ -1,10 +0,0 @@ -import java.util.*; - -interface innerParameter { - interface SuperInnerParam { - T typeForSubstitute(); - } - - interface MidInnerParam extends SuperInnerParam { - } -} \ No newline at end of file diff --git a/idea/testData/typeSubstitution/intersectionType.java b/idea/testData/typeSubstitution/intersectionType.java deleted file mode 100644 index 4aeaa7c401c..00000000000 --- a/idea/testData/typeSubstitution/intersectionType.java +++ /dev/null @@ -1,10 +0,0 @@ -import java.util.*; - -interface intersectionType { - interface SuperIntersection { - & List> R typeForSubstitute(); - } - - interface MidIntersection extends SuperIntersection { - } -} \ No newline at end of file diff --git a/idea/testData/typeSubstitution/intersectionTypeAsTypeParameter.java b/idea/testData/typeSubstitution/intersectionTypeAsTypeParameter.java deleted file mode 100644 index 0a6e5912019..00000000000 --- a/idea/testData/typeSubstitution/intersectionTypeAsTypeParameter.java +++ /dev/null @@ -1,10 +0,0 @@ -import java.util.*; - -interface intersectionTypeAsTypeParameter { - interface Super { - & List> Map typeForSubstitute(); - } - - interface Sub extends Super { - } -} \ No newline at end of file diff --git a/idea/testData/typeSubstitution/intersectionTypeInEnum.java b/idea/testData/typeSubstitution/intersectionTypeInEnum.java deleted file mode 100644 index c4f005ce501..00000000000 --- a/idea/testData/typeSubstitution/intersectionTypeInEnum.java +++ /dev/null @@ -1,10 +0,0 @@ -import java.util.*; - -interface intersectionTypeInEnum { - interface Super { - & List> Enum typeForSubstitute(); - } - - interface Sub extends Super { - } -} \ No newline at end of file diff --git a/idea/testData/typeSubstitution/intersectionTypeInInterfaceDeclaration.java b/idea/testData/typeSubstitution/intersectionTypeInInterfaceDeclaration.java deleted file mode 100644 index d3984b60dd1..00000000000 --- a/idea/testData/typeSubstitution/intersectionTypeInInterfaceDeclaration.java +++ /dev/null @@ -1,8 +0,0 @@ -interface intersectionTypeInInterfaceDeclaration { - interface SuperIntersection { - T typeForSubstitute(); - } - - interface MidIntersection extends SuperIntersection { - } -} \ No newline at end of file diff --git a/idea/testData/typeSubstitution/intersectionTypeInTypeVariableClass.java b/idea/testData/typeSubstitution/intersectionTypeInTypeVariableClass.java deleted file mode 100644 index eb6bffbb236..00000000000 --- a/idea/testData/typeSubstitution/intersectionTypeInTypeVariableClass.java +++ /dev/null @@ -1,10 +0,0 @@ -import java.util.*; - -interface intersectionTypeInTypeVariableClass { - interface Super { - & List> TypeVariable typeForSubstitute(); - } - - interface Sub extends Super { - } -} \ No newline at end of file diff --git a/idea/testData/typeSubstitution/mapEntry.java b/idea/testData/typeSubstitution/mapEntry.java deleted file mode 100644 index ee711c4596e..00000000000 --- a/idea/testData/typeSubstitution/mapEntry.java +++ /dev/null @@ -1,10 +0,0 @@ -import java.util.Map; - -interface mapEntry { - interface Super { - Map.Entry typeForSubstitute(); - } - - interface Mid extends Super { - } -} \ No newline at end of file diff --git a/idea/testData/typeSubstitution/primitiveType.java b/idea/testData/typeSubstitution/primitiveType.java deleted file mode 100644 index e28c8a1808f..00000000000 --- a/idea/testData/typeSubstitution/primitiveType.java +++ /dev/null @@ -1,8 +0,0 @@ -interface primitiveType { - interface SuperPrimitive { - int typeForSubstitute(); - } - - interface MidPrimitive extends SuperPrimitive { - } -} \ No newline at end of file diff --git a/idea/testData/typeSubstitution/rawArrayType.java b/idea/testData/typeSubstitution/rawArrayType.java deleted file mode 100644 index 18bc5e67a5c..00000000000 --- a/idea/testData/typeSubstitution/rawArrayType.java +++ /dev/null @@ -1,8 +0,0 @@ -interface rawArrayType { - interface SuperArray { - T[] typeForSubstitute(); - } - - interface MidArray extends SuperArray { - } -} \ No newline at end of file diff --git a/idea/testData/typeSubstitution/rawArrayTypeParameterWithBound.java b/idea/testData/typeSubstitution/rawArrayTypeParameterWithBound.java deleted file mode 100644 index 3c97bffd13c..00000000000 --- a/idea/testData/typeSubstitution/rawArrayTypeParameterWithBound.java +++ /dev/null @@ -1,8 +0,0 @@ -interface rawArrayTypeParameterWithBound { - interface Super { - T[] typeForSubstitute(); - } - - interface Sub extends Super { - } -} \ No newline at end of file diff --git a/idea/testData/typeSubstitution/rawEnum.java b/idea/testData/typeSubstitution/rawEnum.java deleted file mode 100644 index 2320cbd9070..00000000000 --- a/idea/testData/typeSubstitution/rawEnum.java +++ /dev/null @@ -1,8 +0,0 @@ -interface rawEnum { - interface Super> { - Enum typeForSubstitute(); - } - - interface Sub extends Super { - } -} \ No newline at end of file diff --git a/idea/testData/typeSubstitution/rawExtendsWildcard.java b/idea/testData/typeSubstitution/rawExtendsWildcard.java deleted file mode 100644 index 026c9229551..00000000000 --- a/idea/testData/typeSubstitution/rawExtendsWildcard.java +++ /dev/null @@ -1,10 +0,0 @@ -import java.util.*; - -interface rawExtendsWildcard { - interface SuperRawWild { - List typeForSubstitute(); - } - - interface MidRawWildcard extends SuperRawWild { - } -} \ No newline at end of file diff --git a/idea/testData/typeSubstitution/rawIntersectionType.java b/idea/testData/typeSubstitution/rawIntersectionType.java deleted file mode 100644 index 3a568159dcb..00000000000 --- a/idea/testData/typeSubstitution/rawIntersectionType.java +++ /dev/null @@ -1,8 +0,0 @@ -interface rawIntersectionType { - interface Super { - T typeForSubstitute(); - } - - interface Sub extends Super { - } -} \ No newline at end of file diff --git a/idea/testData/typeSubstitution/rawSuperWildcard.java b/idea/testData/typeSubstitution/rawSuperWildcard.java deleted file mode 100644 index 85fb61c8943..00000000000 --- a/idea/testData/typeSubstitution/rawSuperWildcard.java +++ /dev/null @@ -1,10 +0,0 @@ -import java.util.*; - -interface rawSuperWildcard { - interface SuperRawWild { - List typeForSubstitute(); - } - - interface MidRawWildcard extends SuperRawWild { - } -} \ No newline at end of file diff --git a/idea/testData/typeSubstitution/rawType.java b/idea/testData/typeSubstitution/rawType.java deleted file mode 100644 index f928f813758..00000000000 --- a/idea/testData/typeSubstitution/rawType.java +++ /dev/null @@ -1,8 +0,0 @@ -interface rawType { - interface Super { - T typeForSubstitute(); - } - - interface MidRaw extends Super { - } -} \ No newline at end of file diff --git a/idea/testData/typeSubstitution/rawTypeInDeclaration.java b/idea/testData/typeSubstitution/rawTypeInDeclaration.java deleted file mode 100644 index e912477d946..00000000000 --- a/idea/testData/typeSubstitution/rawTypeInDeclaration.java +++ /dev/null @@ -1,10 +0,0 @@ -import java.util.*; - -interface rawTypeInDeclaration { - interface Super { - List typeForSubstitute(); - } - - interface Sub extends Super { - } -} \ No newline at end of file diff --git a/idea/testData/typeSubstitution/rawTypeWithBound.java b/idea/testData/typeSubstitution/rawTypeWithBound.java deleted file mode 100644 index e96a9e36bf4..00000000000 --- a/idea/testData/typeSubstitution/rawTypeWithBound.java +++ /dev/null @@ -1,8 +0,0 @@ -interface rawTypeWithBound { - interface Super { - T typeForSubstitute(); - } - - interface MidRaw extends Super { - } -} \ No newline at end of file diff --git a/idea/testData/typeSubstitution/rawTypeWithSelfReferenceBound.java b/idea/testData/typeSubstitution/rawTypeWithSelfReferenceBound.java deleted file mode 100644 index e8375c373e8..00000000000 --- a/idea/testData/typeSubstitution/rawTypeWithSelfReferenceBound.java +++ /dev/null @@ -1,8 +0,0 @@ -interface rawTypeWithSelfReferenceBound { - interface Super> { - T typeForSubstitute(); - } - - interface MidRaw extends Super { - } -} \ No newline at end of file diff --git a/idea/testData/typeSubstitution/rawWildcardInTypeVariableClass.java b/idea/testData/typeSubstitution/rawWildcardInTypeVariableClass.java deleted file mode 100644 index 6d4c7a75042..00000000000 --- a/idea/testData/typeSubstitution/rawWildcardInTypeVariableClass.java +++ /dev/null @@ -1,10 +0,0 @@ -import java.lang.reflect.TypeVariable; - -interface rawWildcardInTypeVariableClass { - interface Super { - TypeVariable typeForSubstitute(); - } - - interface Sub extends Super { - } -} \ No newline at end of file diff --git a/idea/testData/typeSubstitution/rawWildcardWithBound.java b/idea/testData/typeSubstitution/rawWildcardWithBound.java deleted file mode 100644 index fba6ef0157a..00000000000 --- a/idea/testData/typeSubstitution/rawWildcardWithBound.java +++ /dev/null @@ -1,10 +0,0 @@ -import java.util.*; - -interface rawWildcardWithBound { - interface Super { - List typeForSubstitute(); - } - - interface Sub extends Super { - } -} \ No newline at end of file diff --git a/idea/testData/typeSubstitution/selfReference.java b/idea/testData/typeSubstitution/selfReference.java deleted file mode 100644 index c6958f1e916..00000000000 --- a/idea/testData/typeSubstitution/selfReference.java +++ /dev/null @@ -1,10 +0,0 @@ -import java.util.*; - -interface selfReference { - interface SuperSelfRef> { - public List typeForSubstitute(); - } - - interface MidSelfRef extends SuperSelfRef { - } -} \ No newline at end of file diff --git a/idea/testData/typeSubstitution/twoParameters.java b/idea/testData/typeSubstitution/twoParameters.java deleted file mode 100644 index d4508cd37d5..00000000000 --- a/idea/testData/typeSubstitution/twoParameters.java +++ /dev/null @@ -1,10 +0,0 @@ -import java.util.*; - -interface twoParameters { - interface SuperTwoParams { - Map> typeForSubstitute(); - } - - interface MidTwoParams extends SuperTwoParams { - } -} \ No newline at end of file diff --git a/idea/testData/typeSubstitution/twoParametersInSubClass.java b/idea/testData/typeSubstitution/twoParametersInSubClass.java deleted file mode 100644 index 579cbfc3b8a..00000000000 --- a/idea/testData/typeSubstitution/twoParametersInSubClass.java +++ /dev/null @@ -1,10 +0,0 @@ -import java.util.*; - -interface twoParametersInSubClass { - interface SuperTwoParams { - List typeForSubstitute(); - } - - interface MidTwoParams extends SuperTwoParams { - } -} \ No newline at end of file diff --git a/idea/testData/typeSubstitution/typeVariableClass.java b/idea/testData/typeSubstitution/typeVariableClass.java deleted file mode 100644 index b738ab5e1b3..00000000000 --- a/idea/testData/typeSubstitution/typeVariableClass.java +++ /dev/null @@ -1,10 +0,0 @@ -import java.lang.reflect.TypeVariable; - -interface typeVariableClass { - interface Super { - TypeVariable typeForSubstitute(); - } - - interface Mid extends Super { - } -} \ No newline at end of file diff --git a/idea/testData/typeSubstitution/typeVariableRaw.java b/idea/testData/typeSubstitution/typeVariableRaw.java deleted file mode 100644 index 37464247d2c..00000000000 --- a/idea/testData/typeSubstitution/typeVariableRaw.java +++ /dev/null @@ -1,10 +0,0 @@ -import java.lang.reflect.TypeVariable; - -interface typeVariableRaw { - interface Super { - TypeVariable typeForSubstitute(); - } - - interface Mid extends Super { - } -} \ No newline at end of file diff --git a/idea/testData/typeSubstitution/unboundedWildcard.java b/idea/testData/typeSubstitution/unboundedWildcard.java deleted file mode 100644 index 232230bf9d4..00000000000 --- a/idea/testData/typeSubstitution/unboundedWildcard.java +++ /dev/null @@ -1,10 +0,0 @@ -import java.util.*; - -interface unboundedWildcard { - interface Super { - List typeForSubstitute(); - } - - interface Sub extends Super { - } -} \ No newline at end of file diff --git a/idea/testData/typeSubstitution/unboundedWildcardToTypeParameter.java b/idea/testData/typeSubstitution/unboundedWildcardToTypeParameter.java deleted file mode 100644 index 981d5adf796..00000000000 --- a/idea/testData/typeSubstitution/unboundedWildcardToTypeParameter.java +++ /dev/null @@ -1,8 +0,0 @@ -import java.util.*; - -interface unboundedWildcardToTypeParameter { - interface SupList extends List { - @Override - boolean retainAll(Collection c); // error, check that we do not fall - } -} \ No newline at end of file diff --git a/idea/testData/typeSubstitution/varargArray.java b/idea/testData/typeSubstitution/varargArray.java deleted file mode 100644 index 853db136a2c..00000000000 --- a/idea/testData/typeSubstitution/varargArray.java +++ /dev/null @@ -1,10 +0,0 @@ -import java.util.*; - -interface varargArray { - interface Super { - void typeForSubstitute(T... a); - } - - interface Sub extends Super { - } -} \ No newline at end of file diff --git a/idea/testData/typeSubstitution/varargArrayTypeParameter.java b/idea/testData/typeSubstitution/varargArrayTypeParameter.java deleted file mode 100644 index 0343a15100c..00000000000 --- a/idea/testData/typeSubstitution/varargArrayTypeParameter.java +++ /dev/null @@ -1,10 +0,0 @@ -import java.util.*; - -interface varargArrayTypeParameter { - interface Super { - void typeForSubstitute(T... a); - } - - interface Sub extends Super { - } -} \ No newline at end of file diff --git a/idea/testData/typeSubstitution/varargClass.java b/idea/testData/typeSubstitution/varargClass.java deleted file mode 100644 index 371b6d1226e..00000000000 --- a/idea/testData/typeSubstitution/varargClass.java +++ /dev/null @@ -1,10 +0,0 @@ -import java.util.*; - -interface varargClass { - interface Super { - void typeForSubstitute(List... a); - } - - interface Sub extends Super { - } -} \ No newline at end of file diff --git a/idea/testData/typeSubstitution/varargClassWithWildcard.java b/idea/testData/typeSubstitution/varargClassWithWildcard.java deleted file mode 100644 index 3aa87dfda7d..00000000000 --- a/idea/testData/typeSubstitution/varargClassWithWildcard.java +++ /dev/null @@ -1,10 +0,0 @@ -import java.util.*; - -interface varargClassWithWildcard { - interface Super { - void typeForSubstitute(List... a); - } - - interface Sub extends Super> { - } -} \ No newline at end of file diff --git a/idea/testData/typeSubstitution/varargRawType.java b/idea/testData/typeSubstitution/varargRawType.java deleted file mode 100644 index 78a6b2515b2..00000000000 --- a/idea/testData/typeSubstitution/varargRawType.java +++ /dev/null @@ -1,10 +0,0 @@ -import java.util.*; - -interface varargRawType { - interface Super { - void typeForSubstitute(T... a); - } - - interface Sub extends Super { - } -} \ No newline at end of file diff --git a/idea/testData/typeSubstitution/varargRawTypeWithBound.java b/idea/testData/typeSubstitution/varargRawTypeWithBound.java deleted file mode 100644 index cc7f8e8fb8b..00000000000 --- a/idea/testData/typeSubstitution/varargRawTypeWithBound.java +++ /dev/null @@ -1,10 +0,0 @@ -import java.util.*; - -interface varargRawTypeWithBound { - interface Super { - void typeForSubstitute(T... a); - } - - interface Sub extends Super { - } -} \ No newline at end of file diff --git a/idea/testData/typeSubstitution/varargToClass.java b/idea/testData/typeSubstitution/varargToClass.java deleted file mode 100644 index 7132de49e80..00000000000 --- a/idea/testData/typeSubstitution/varargToClass.java +++ /dev/null @@ -1,10 +0,0 @@ -import java.util.*; - -interface varargToClass { - interface Super { - void typeForSubstitute(T... a); - } - - interface Sub extends Super { - } -} \ No newline at end of file diff --git a/idea/testData/typeSubstitution/varargToClassWithWildcard.java b/idea/testData/typeSubstitution/varargToClassWithWildcard.java deleted file mode 100644 index 93dc3b520af..00000000000 --- a/idea/testData/typeSubstitution/varargToClassWithWildcard.java +++ /dev/null @@ -1,10 +0,0 @@ -import java.util.*; - -interface varargToClassWithWildcard { - interface Super { - void typeForSubstitute(T... a); - } - - interface Sub extends Super> { - } -} \ No newline at end of file diff --git a/idea/testData/typeSubstitution/wildcardExtends.java b/idea/testData/typeSubstitution/wildcardExtends.java deleted file mode 100644 index 721942f6376..00000000000 --- a/idea/testData/typeSubstitution/wildcardExtends.java +++ /dev/null @@ -1,10 +0,0 @@ -import java.util.*; - -interface wildcardExtends { - interface SuperWildcardExtends { - List typeForSubstitute(); - } - - interface MidWildcardExtends extends SuperWildcardExtends { - } -} \ No newline at end of file diff --git a/idea/testData/typeSubstitution/wildcardExtendsObject.java b/idea/testData/typeSubstitution/wildcardExtendsObject.java deleted file mode 100644 index 40e18ca5a83..00000000000 --- a/idea/testData/typeSubstitution/wildcardExtendsObject.java +++ /dev/null @@ -1,10 +0,0 @@ -import java.util.*; - -interface wildcardExtendsObject { - interface SuperWildcardExtendsObject { - List typeForSubstitute(); - } - - interface MidWildcardExtendsObject extends SuperWildcardExtendsObject { - } -} \ No newline at end of file diff --git a/idea/testData/typeSubstitution/wildcardExtendsTypeParameter.java b/idea/testData/typeSubstitution/wildcardExtendsTypeParameter.java deleted file mode 100644 index d62939b11f3..00000000000 --- a/idea/testData/typeSubstitution/wildcardExtendsTypeParameter.java +++ /dev/null @@ -1,10 +0,0 @@ -import java.util.*; - -interface wildcardExtendsTypeParameter { - interface SuperWildcard { - Map typeForSubstitute(); - } - - interface MidWildcard extends SuperWildcard { - } -} \ No newline at end of file diff --git a/idea/testData/typeSubstitution/wildcardSuper.java b/idea/testData/typeSubstitution/wildcardSuper.java deleted file mode 100644 index b1342fb7f1f..00000000000 --- a/idea/testData/typeSubstitution/wildcardSuper.java +++ /dev/null @@ -1,10 +0,0 @@ -import java.util.*; - -interface wildcardSuper { - interface SuperWildcardSuper { - List typeForSubstitute(); - } - - interface MidWildcardSuper extends SuperWildcardSuper { - } -} \ No newline at end of file diff --git a/idea/testData/typeSubstitution/wildcardToWildcard.java b/idea/testData/typeSubstitution/wildcardToWildcard.java deleted file mode 100644 index d52b18dd53c..00000000000 --- a/idea/testData/typeSubstitution/wildcardToWildcard.java +++ /dev/null @@ -1,8 +0,0 @@ -import java.util.*; - -interface wildcardToWildcard { - interface SupList extends List { - @Override - boolean addAll(Collection c); - } -} \ No newline at end of file diff --git a/idea/tests/org/jetbrains/kotlin/load/java/AbstractJavaTypeSubstitutorTest.java b/idea/tests/org/jetbrains/kotlin/load/java/AbstractJavaTypeSubstitutorTest.java deleted file mode 100644 index 1574ca798b6..00000000000 --- a/idea/tests/org/jetbrains/kotlin/load/java/AbstractJavaTypeSubstitutorTest.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright 2010-2015 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.kotlin.load.java; - -import com.intellij.openapi.project.Project; -import com.intellij.psi.*; -import com.intellij.psi.search.GlobalSearchScope; -import com.intellij.testFramework.LightProjectDescriptor; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightFixtureTestCase; -import org.jetbrains.kotlin.idea.test.KotlinLightProjectDescriptor; -import org.jetbrains.kotlin.load.java.structure.JavaType; -import org.jetbrains.kotlin.load.java.structure.impl.JavaClassifierTypeImpl; -import org.jetbrains.kotlin.load.java.structure.impl.JavaTypeImpl; -import org.jetbrains.kotlin.load.java.structure.impl.JavaTypeParameterImpl; - -public abstract class AbstractJavaTypeSubstitutorTest extends KotlinLightCodeInsightFixtureTestCase { - @NotNull - @Override - protected LightProjectDescriptor getProjectDescriptor() { - return KotlinLightProjectDescriptor.INSTANCE; - } - - public void doTest(@NotNull String testFile) { - PsiFile psiFile = myFixture.configureByFile(testFile); - - Project project = myFixture.getProject(); - String javaClassName = psiFile.getName().substring(0, psiFile.getName().length() - ".java".length()); - PsiClass psiClass = JavaPsiFacade.getInstance(project).findClass(javaClassName, GlobalSearchScope.allScope(project)); - assert psiClass != null : "Wrong path to test file: " + testFile; - - assert psiClass.getInnerClasses().length > 0; - - for (PsiClass innerInterface : psiClass.getInnerClasses()) { - PsiMethod method = getMethodWithTestData(innerInterface); - - PsiClassType[] superTypes = innerInterface.getSuperTypes(); - for (PsiClassType superType : superTypes) { - if (method.getReturnType() != null) { - doTest(superType, method.getReturnType()); - } - if (method.getTypeParameters().length > 0) { - doTest(superType, method.getTypeParameters()[0]); - } - PsiParameter[] parameters = method.getParameterList().getParameters(); - if (parameters.length > 0) { - doTest(superType, parameters[0].getType()); - } - } - } - } - - private static void doTest(@NotNull PsiClassType type, @NotNull PsiTypeParameter typeParameter) { - PsiType expectedType = type.resolveGenerics().getSubstitutor().substitute(typeParameter); - - JavaClassifierTypeImpl javaClassifierType = (JavaClassifierTypeImpl) JavaTypeImpl.create(type); - JavaTypeParameterImpl javaTypeToSubstitute = new JavaTypeParameterImpl(typeParameter); - JavaType actualType = javaClassifierType.getSubstitutor().substitute(javaTypeToSubstitute); - - if (actualType == null) { - assertEquals(expectedType, null); - } - else { - assertEquals(expectedType, ((JavaTypeImpl) actualType).getPsi()); - } - } - - private static void doTest(@NotNull PsiClassType type, @NotNull PsiType psiTypeToSubstitute) { - PsiType expectedType = type.resolveGenerics().getSubstitutor().substitute(psiTypeToSubstitute); - - JavaClassifierTypeImpl javaClassifierType = (JavaClassifierTypeImpl) JavaTypeImpl.create(type); - JavaTypeImpl javaTypeToSubstitute = JavaTypeImpl.create(psiTypeToSubstitute); - JavaType actualType = javaClassifierType.getSubstitutor().substitute(javaTypeToSubstitute); - - if (expectedType instanceof PsiEllipsisType) { - PsiEllipsisType ellipsisType = (PsiEllipsisType) expectedType; - assertEquals(ellipsisType.toArrayType(), ((JavaTypeImpl) actualType).getPsi()); - } - else { - assertEquals(expectedType, ((JavaTypeImpl) actualType).getPsi()); - } - } - - @NotNull - private static PsiMethod getMethodWithTestData(@NotNull PsiClass psiClass) { - String substituteParameterName = "typeForSubstitute"; - PsiMethod[] methods = psiClass.findMethodsByName(substituteParameterName, false); - if (methods.length == 0) { - methods = psiClass.findMethodsByName(substituteParameterName, true); - } - - if (methods.length == 0) { - methods = psiClass.getMethods(); - } - - assert methods.length > 0 : "Wrong parameters for test: method typeForSubstitute not found"; - - return methods[0]; - } -} diff --git a/idea/tests/org/jetbrains/kotlin/load/java/JavaTypeSubstitutorTestGenerated.java b/idea/tests/org/jetbrains/kotlin/load/java/JavaTypeSubstitutorTestGenerated.java deleted file mode 100644 index 9724ee709b9..00000000000 --- a/idea/tests/org/jetbrains/kotlin/load/java/JavaTypeSubstitutorTestGenerated.java +++ /dev/null @@ -1,301 +0,0 @@ -/* - * Copyright 2010-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.kotlin.load.java; - -import com.intellij.testFramework.TestDataPath; -import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; -import org.jetbrains.kotlin.test.KotlinTestUtils; -import org.jetbrains.kotlin.test.TestMetadata; -import org.junit.runner.RunWith; - -import java.io.File; -import java.util.regex.Pattern; - -/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ -@SuppressWarnings("all") -@TestMetadata("idea/testData/typeSubstitution") -@TestDataPath("$PROJECT_ROOT") -@RunWith(JUnit3RunnerWithInners.class) -public class JavaTypeSubstitutorTestGenerated extends AbstractJavaTypeSubstitutorTest { - public void testAllFilesPresentInTypeSubstitution() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/typeSubstitution"), Pattern.compile("^(.+)\\.java$"), true); - } - - @TestMetadata("arrayType.java") - public void testArrayType() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("idea/testData/typeSubstitution/arrayType.java"); - doTest(fileName); - } - - @TestMetadata("classType.java") - public void testClassType() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("idea/testData/typeSubstitution/classType.java"); - doTest(fileName); - } - - @TestMetadata("classWithWildcard.java") - public void testClassWithWildcard() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("idea/testData/typeSubstitution/classWithWildcard.java"); - doTest(fileName); - } - - @TestMetadata("genericArray.java") - public void testGenericArray() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("idea/testData/typeSubstitution/genericArray.java"); - doTest(fileName); - } - - @TestMetadata("innerParameter.java") - public void testInnerParameter() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("idea/testData/typeSubstitution/innerParameter.java"); - doTest(fileName); - } - - @TestMetadata("intersectionType.java") - public void testIntersectionType() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("idea/testData/typeSubstitution/intersectionType.java"); - doTest(fileName); - } - - @TestMetadata("intersectionTypeAsTypeParameter.java") - public void testIntersectionTypeAsTypeParameter() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("idea/testData/typeSubstitution/intersectionTypeAsTypeParameter.java"); - doTest(fileName); - } - - @TestMetadata("intersectionTypeInEnum.java") - public void testIntersectionTypeInEnum() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("idea/testData/typeSubstitution/intersectionTypeInEnum.java"); - doTest(fileName); - } - - @TestMetadata("intersectionTypeInInterfaceDeclaration.java") - public void testIntersectionTypeInInterfaceDeclaration() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("idea/testData/typeSubstitution/intersectionTypeInInterfaceDeclaration.java"); - doTest(fileName); - } - - @TestMetadata("intersectionTypeInTypeVariableClass.java") - public void testIntersectionTypeInTypeVariableClass() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("idea/testData/typeSubstitution/intersectionTypeInTypeVariableClass.java"); - doTest(fileName); - } - - @TestMetadata("mapEntry.java") - public void testMapEntry() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("idea/testData/typeSubstitution/mapEntry.java"); - doTest(fileName); - } - - @TestMetadata("primitiveType.java") - public void testPrimitiveType() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("idea/testData/typeSubstitution/primitiveType.java"); - doTest(fileName); - } - - @TestMetadata("rawArrayType.java") - public void testRawArrayType() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("idea/testData/typeSubstitution/rawArrayType.java"); - doTest(fileName); - } - - @TestMetadata("rawArrayTypeParameterWithBound.java") - public void testRawArrayTypeParameterWithBound() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("idea/testData/typeSubstitution/rawArrayTypeParameterWithBound.java"); - doTest(fileName); - } - - @TestMetadata("rawEnum.java") - public void testRawEnum() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("idea/testData/typeSubstitution/rawEnum.java"); - doTest(fileName); - } - - @TestMetadata("rawExtendsWildcard.java") - public void testRawExtendsWildcard() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("idea/testData/typeSubstitution/rawExtendsWildcard.java"); - doTest(fileName); - } - - @TestMetadata("rawIntersectionType.java") - public void testRawIntersectionType() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("idea/testData/typeSubstitution/rawIntersectionType.java"); - doTest(fileName); - } - - @TestMetadata("rawSuperWildcard.java") - public void testRawSuperWildcard() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("idea/testData/typeSubstitution/rawSuperWildcard.java"); - doTest(fileName); - } - - @TestMetadata("rawType.java") - public void testRawType() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("idea/testData/typeSubstitution/rawType.java"); - doTest(fileName); - } - - @TestMetadata("rawTypeInDeclaration.java") - public void testRawTypeInDeclaration() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("idea/testData/typeSubstitution/rawTypeInDeclaration.java"); - doTest(fileName); - } - - @TestMetadata("rawTypeWithBound.java") - public void testRawTypeWithBound() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("idea/testData/typeSubstitution/rawTypeWithBound.java"); - doTest(fileName); - } - - @TestMetadata("rawTypeWithSelfReferenceBound.java") - public void testRawTypeWithSelfReferenceBound() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("idea/testData/typeSubstitution/rawTypeWithSelfReferenceBound.java"); - doTest(fileName); - } - - @TestMetadata("rawWildcardInTypeVariableClass.java") - public void testRawWildcardInTypeVariableClass() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("idea/testData/typeSubstitution/rawWildcardInTypeVariableClass.java"); - doTest(fileName); - } - - @TestMetadata("rawWildcardWithBound.java") - public void testRawWildcardWithBound() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("idea/testData/typeSubstitution/rawWildcardWithBound.java"); - doTest(fileName); - } - - @TestMetadata("selfReference.java") - public void testSelfReference() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("idea/testData/typeSubstitution/selfReference.java"); - doTest(fileName); - } - - @TestMetadata("twoParameters.java") - public void testTwoParameters() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("idea/testData/typeSubstitution/twoParameters.java"); - doTest(fileName); - } - - @TestMetadata("twoParametersInSubClass.java") - public void testTwoParametersInSubClass() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("idea/testData/typeSubstitution/twoParametersInSubClass.java"); - doTest(fileName); - } - - @TestMetadata("typeVariableClass.java") - public void testTypeVariableClass() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("idea/testData/typeSubstitution/typeVariableClass.java"); - doTest(fileName); - } - - @TestMetadata("typeVariableRaw.java") - public void testTypeVariableRaw() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("idea/testData/typeSubstitution/typeVariableRaw.java"); - doTest(fileName); - } - - @TestMetadata("unboundedWildcard.java") - public void testUnboundedWildcard() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("idea/testData/typeSubstitution/unboundedWildcard.java"); - doTest(fileName); - } - - @TestMetadata("unboundedWildcardToTypeParameter.java") - public void testUnboundedWildcardToTypeParameter() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("idea/testData/typeSubstitution/unboundedWildcardToTypeParameter.java"); - doTest(fileName); - } - - @TestMetadata("varargArray.java") - public void testVarargArray() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("idea/testData/typeSubstitution/varargArray.java"); - doTest(fileName); - } - - @TestMetadata("varargArrayTypeParameter.java") - public void testVarargArrayTypeParameter() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("idea/testData/typeSubstitution/varargArrayTypeParameter.java"); - doTest(fileName); - } - - @TestMetadata("varargClass.java") - public void testVarargClass() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("idea/testData/typeSubstitution/varargClass.java"); - doTest(fileName); - } - - @TestMetadata("varargClassWithWildcard.java") - public void testVarargClassWithWildcard() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("idea/testData/typeSubstitution/varargClassWithWildcard.java"); - doTest(fileName); - } - - @TestMetadata("varargRawType.java") - public void testVarargRawType() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("idea/testData/typeSubstitution/varargRawType.java"); - doTest(fileName); - } - - @TestMetadata("varargRawTypeWithBound.java") - public void testVarargRawTypeWithBound() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("idea/testData/typeSubstitution/varargRawTypeWithBound.java"); - doTest(fileName); - } - - @TestMetadata("varargToClass.java") - public void testVarargToClass() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("idea/testData/typeSubstitution/varargToClass.java"); - doTest(fileName); - } - - @TestMetadata("varargToClassWithWildcard.java") - public void testVarargToClassWithWildcard() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("idea/testData/typeSubstitution/varargToClassWithWildcard.java"); - doTest(fileName); - } - - @TestMetadata("wildcardExtends.java") - public void testWildcardExtends() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("idea/testData/typeSubstitution/wildcardExtends.java"); - doTest(fileName); - } - - @TestMetadata("wildcardExtendsObject.java") - public void testWildcardExtendsObject() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("idea/testData/typeSubstitution/wildcardExtendsObject.java"); - doTest(fileName); - } - - @TestMetadata("wildcardExtendsTypeParameter.java") - public void testWildcardExtendsTypeParameter() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("idea/testData/typeSubstitution/wildcardExtendsTypeParameter.java"); - doTest(fileName); - } - - @TestMetadata("wildcardSuper.java") - public void testWildcardSuper() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("idea/testData/typeSubstitution/wildcardSuper.java"); - doTest(fileName); - } - - @TestMetadata("wildcardToWildcard.java") - public void testWildcardToWildcard() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("idea/testData/typeSubstitution/wildcardToWildcard.java"); - doTest(fileName); - } -}