mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
avoid incorrect signatures to apply (EA-27139 - IOE: PsiJavaParserFacadeImpl.createTypeElementFromText)
This commit is contained in:
+5
@@ -60,6 +60,11 @@ public class JavaChangeSignatureDetector implements LanguageChangeSignatureDetec
|
||||
try {
|
||||
newReturnType = returnType != null ? CanonicalTypes.createTypeWrapper(returnType) : null;
|
||||
parameterInfos = ParameterInfoImpl.fromMethod(method);
|
||||
for (ParameterInfoImpl parameterInfo : parameterInfos) {
|
||||
if (!parameterInfo.getTypeWrapper().isValid()) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (IncorrectOperationException e) {
|
||||
return null;
|
||||
|
||||
@@ -46,6 +46,10 @@ public class CanonicalTypes {
|
||||
public abstract String getTypeText();
|
||||
|
||||
public abstract void addImportsTo(final JavaCodeFragment codeFragment);
|
||||
|
||||
public boolean isValid() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
private static class Primitive extends Type {
|
||||
@@ -86,6 +90,11 @@ public class CanonicalTypes {
|
||||
public void addImportsTo(final JavaCodeFragment codeFragment) {
|
||||
myComponentType.addImportsTo(codeFragment);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid() {
|
||||
return myComponentType.isValid();
|
||||
}
|
||||
}
|
||||
|
||||
private static class Ellipsis extends Type {
|
||||
@@ -107,6 +116,11 @@ public class CanonicalTypes {
|
||||
public void addImportsTo(final JavaCodeFragment codeFragment) {
|
||||
myComponentType.addImportsTo(codeFragment);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid() {
|
||||
return myComponentType.isValid();
|
||||
}
|
||||
}
|
||||
|
||||
private static class WildcardType extends Type {
|
||||
@@ -137,6 +151,11 @@ public class CanonicalTypes {
|
||||
public void addImportsTo(final JavaCodeFragment codeFragment) {
|
||||
if (myBound != null) myBound.addImportsTo(codeFragment);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid() {
|
||||
return myBound == null || myBound.isValid();
|
||||
}
|
||||
}
|
||||
|
||||
private static class WrongType extends Type {
|
||||
@@ -156,6 +175,11 @@ public class CanonicalTypes {
|
||||
}
|
||||
|
||||
public void addImportsTo(final JavaCodeFragment codeFragment) {}
|
||||
|
||||
@Override
|
||||
public boolean isValid() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private static class ClassType extends Type {
|
||||
|
||||
Reference in New Issue
Block a user