Multi-catch type API cleanup

This commit is contained in:
Roman Shevchenko
2011-02-22 10:06:01 +01:00
parent 9e9584b4a5
commit a060107f89
3 changed files with 6 additions and 6 deletions
@@ -177,7 +177,7 @@ public class PsiSubstitutorImpl implements PsiSubstitutor {
final List<PsiType> substituted = ContainerUtil.map(disjunctionType.getDisjunctions(), new Function<PsiType, PsiType>() {
@Override public PsiType fun(PsiType psiType) { return psiType.accept(SubstitutionVisitorBase.this); }
});
return new PsiDisjunctionType(substituted, disjunctionType.getManager());
return disjunctionType.newDisjunctionType(substituted);
}
}
@@ -30,8 +30,8 @@ import java.util.Collections;
import java.util.List;
/**
* Composite type resulting from Project Coin's multi-catch statements, * i.e. <code>FileNotFoundException | EOFException</code>.
* In most cases should be threatened via its least upper bound * (<code>IOException</code> in the example above).
* Composite type resulting from Project Coin's multi-catch statements, i.e. <code>FileNotFoundException | EOFException</code>.
* In most cases should be threatened via its least upper bound (<code>IOException</code> in the example above).
*/
public class PsiDisjunctionType extends PsiType {
private final PsiManager myManager;
@@ -64,8 +64,8 @@ public class PsiDisjunctionType extends PsiType {
return myTypes;
}
public PsiManager getManager() {
return myManager;
public PsiDisjunctionType newDisjunctionType(final List<PsiType> types) {
return new PsiDisjunctionType(types, myManager);
}
@Override
@@ -1170,7 +1170,7 @@ public class TypeConversionUtil {
final List<PsiType> erased = ContainerUtil.map(disjunctionType.getDisjunctions(), new Function<PsiType, PsiType>() {
@Override public PsiType fun(PsiType psiType) { return erasure(psiType, beforeSubstitutor); }
});
return new PsiDisjunctionType(erased, disjunctionType.getManager());
return disjunctionType.newDisjunctionType(erased);
}
});
}