mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[java] fixes NPE in type parser (EA-104664)
This commit is contained in:
@@ -133,6 +133,7 @@ public class ReferenceParser {
|
||||
type.drop();
|
||||
if (anno != null && isSet(flags, INCOMPLETE_ANNO)) {
|
||||
error(builder, JavaErrorMessages.message("expected.type"));
|
||||
typeInfo.marker = anno;
|
||||
typeInfo.hasErrors = true;
|
||||
return typeInfo;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
PsiJavaFile:CorruptAnnoInCast.java
|
||||
PsiParenthesizedExpression:(
|
||||
PsiJavaToken:LPARENTH('(')
|
||||
PsiErrorElement:Expression expected
|
||||
<empty list>
|
||||
PsiErrorElement:Unparsed tokens
|
||||
PsiJavaToken:AT('@')
|
||||
PsiJavaToken:AND('&')
|
||||
@@ -105,6 +105,7 @@ public class ExpressionParserTest extends JavaParsingTestCase {
|
||||
|
||||
public void testIncompleteCast() { doParserTest("f((ArrayList<String>) )"); }
|
||||
public void testShiftRight() { doParserTest("x >>= 2"); }
|
||||
public void testCorruptAnnoInCast() { doParserTest("(@&"); }
|
||||
|
||||
public void testIllegalWildcard() { doParserTest("this.<?>foo()"); }
|
||||
public void testIllegalBound() { doParserTest("C.<T extends S>foo()"); }
|
||||
|
||||
Reference in New Issue
Block a user