mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
revert disjunction elimination in common api
This commit is contained in:
+6
-1
@@ -333,6 +333,9 @@ public class ChangeMethodSignatureFromUsageFix implements IntentionAction/*, Hig
|
||||
else {
|
||||
PsiType exprType = RefactoringUtil.getTypeByExpression(expression);
|
||||
if (exprType == null) return null;
|
||||
if (exprType instanceof PsiDisjunctionType) {
|
||||
exprType = ((PsiDisjunctionType)exprType).getLeastUpperBound();
|
||||
}
|
||||
final ParameterInfoImpl changedParameterInfo = new ParameterInfoImpl(i, parameter.getName(), exprType);
|
||||
result.add(changedParameterInfo);
|
||||
changedParams.add(changedParameterInfo);
|
||||
@@ -403,7 +406,9 @@ public class ChangeMethodSignatureFromUsageFix implements IntentionAction/*, Hig
|
||||
if (varargParam != null && pi >= parameters.length) return false;
|
||||
PsiType exprType = RefactoringUtil.getTypeByExpression(expression);
|
||||
if (exprType == null) return false;
|
||||
exprType = GenericsUtil.getVariableTypeByExpressionType(exprType);
|
||||
if (exprType instanceof PsiDisjunctionType) {
|
||||
exprType = ((PsiDisjunctionType)exprType).getLeastUpperBound();
|
||||
}
|
||||
JavaCodeStyleManager codeStyleManager = JavaCodeStyleManager.getInstance(expression.getProject());
|
||||
String name = suggestUniqueParameterName(codeStyleManager, expression, exprType, existingNames);
|
||||
final ParameterInfoImpl newParameterInfo = new ParameterInfoImpl(-1, name, exprType, expression.getText().replace('\n', ' '));
|
||||
|
||||
@@ -351,9 +351,6 @@ public class GenericsUtil {
|
||||
@Nullable
|
||||
public static PsiType getVariableTypeByExpressionType(@Nullable PsiType type, final boolean openCaptured) {
|
||||
if (type == null) return null;
|
||||
if (type instanceof PsiDisjunctionType) {
|
||||
type = ((PsiDisjunctionType)type).getLeastUpperBound();
|
||||
}
|
||||
if (type instanceof PsiCapturedWildcardType) {
|
||||
type = ((PsiCapturedWildcardType)type).getWildcard();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user