mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-04 23:39:07 +07:00
[java] catch proper exception from JavaParserDefinition EA-252075
GitOrigin-RevId: caa7054f10819cdd0f0782173a086069072718bc
This commit is contained in:
committed by
intellij-monorepo-bot
parent
3d6d55204b
commit
548ba0899a
@@ -75,6 +75,8 @@ public class JavaParserDefinition implements ParserDefinition {
|
||||
return ((JavaStubElementType<?, ?>)type).createPsi(node);
|
||||
}
|
||||
|
||||
// This exception is caught in com.intellij.psi.impl.source.tree.injected.InjectionRegistrarImpl.findNewInjectionHost
|
||||
// Please, check that code if you make any changes here
|
||||
throw new IllegalArgumentException("Not a Java node: " + node + " (" + type + ", " + type.getLanguage() + ")");
|
||||
}
|
||||
|
||||
|
||||
@@ -758,7 +758,7 @@ class InjectionRegistrarImpl implements MultiHostRegistrar {
|
||||
}
|
||||
// JavaParserDefinition.create() throws this.
|
||||
// DO not over-generalize this exception type to avoid swallowing meaningful exceptions
|
||||
catch (IllegalStateException e) {
|
||||
catch (IllegalArgumentException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user