diamond type visitor
authorAnna Kozlova <anna.kozlova@jetbrains.com>
Wed, 1 Feb 2012 09:16:13 +0000 (13:16 +0400)
committerAnna Kozlova <anna.kozlova@jetbrains.com>
Wed, 1 Feb 2012 09:43:20 +0000 (13:43 +0400)
EA-30757 - assert: PsiSubstitutorImpl$SubstitutionVisitorBase.visitType

java/java-psi-api/src/com/intellij/psi/PsiTypeVisitor.java
java/java-psi-impl/src/com/intellij/psi/PsiDiamondTypeImpl.java
java/java-psi-impl/src/com/intellij/psi/impl/PsiSubstitutorImpl.java

index 045060685ce0657ff40c8f3580da543bae6b1b76..f0e9afd057f20058f7a5aaa75a81af470b8ea213 100644 (file)
@@ -52,4 +52,8 @@ public class PsiTypeVisitor<A> {
   public A visitDisjunctionType(PsiDisjunctionType disjunctionType) {
     return visitType(disjunctionType);
   }
+  
+  public A visitDiamondType(PsiDiamondType diamondType) {
+    return visitType(diamondType);
+  }
 }
index cff23586365fe63a35b2f4acde9c88d620ad9a8e..50341eef31aa5af91782098f50e893b1ecf66806 100644 (file)
@@ -29,7 +29,9 @@ import org.jetbrains.annotations.NonNls;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
-import java.util.*;
+import java.util.Collections;
+import java.util.LinkedHashSet;
+import java.util.Set;
 
 /**
  * User: anna
@@ -73,7 +75,7 @@ public class PsiDiamondTypeImpl extends PsiDiamondType {
 
   @Override
   public <A> A accept(PsiTypeVisitor<A> visitor) {
-    return visitor.visitType(this);
+    return visitor.visitDiamondType(this);
   }
 
   @Override
index 2c67d7eff8bba2c191f60e3ad8be36895b269de7..f9535cbb36959624eb0707ff0078a1cbb255eed6 100644 (file)
@@ -212,6 +212,11 @@ public class PsiSubstitutorImpl implements PsiSubstitutor {
       });
       return disjunctionType.newDisjunctionType(substituted);
     }
+
+    @Override
+    public PsiType visitDiamondType(PsiDiamondType diamondType) {
+      return diamondType;
+    }
   }
 
   private final SubstitutionVisitor myAddingBoundsSubstitutionVisitor = new SubstitutionVisitor(SubstituteKind.ADD_BOUNDS);