mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[java] stubs for 'requires' and 'exports' statement (NPE fix)
This commit is contained in:
+3
-1
@@ -36,6 +36,8 @@ import org.jetbrains.annotations.NotNull;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static com.intellij.util.ObjectUtils.notNull;
|
||||
|
||||
public class JavaExportsStatementElementType extends JavaStubElementType<PsiExportsStatementStub, PsiExportsStatement> {
|
||||
public JavaExportsStatementElementType() {
|
||||
super("EXPORTS_STATEMENT");
|
||||
@@ -68,7 +70,7 @@ public class JavaExportsStatementElementType extends JavaStubElementType<PsiExpo
|
||||
else if (type == JavaElementType.MODULE_REFERENCE) to.add(JavaSourceUtil.getReferenceText(tree, child));
|
||||
}
|
||||
|
||||
return new PsiExportsStatementStubImpl(parentStub, refText, to);
|
||||
return new PsiExportsStatementStubImpl(parentStub, notNull(refText, ""), to);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+3
-1
@@ -35,6 +35,8 @@ import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import static com.intellij.util.ObjectUtils.notNull;
|
||||
|
||||
public class JavaRequiresStatementElementType extends JavaStubElementType<PsiRequiresStatementStub, PsiRequiresStatement> {
|
||||
public JavaRequiresStatementElementType() {
|
||||
super("REQUIRES_STATEMENT");
|
||||
@@ -68,7 +70,7 @@ public class JavaRequiresStatementElementType extends JavaStubElementType<PsiReq
|
||||
else if (type == JavaTokenType.STATIC_KEYWORD) isStatic = true;
|
||||
}
|
||||
|
||||
return new PsiRequiresStatementStubImpl(parentStub, refText, isPublic, isStatic);
|
||||
return new PsiRequiresStatementStubImpl(parentStub, notNull(refText, ""), isPublic, isStatic);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user