mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Multi-catch type API cleanup
This commit is contained in:
@@ -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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user