[java] stubs for 'requires' and 'exports' statement (NPE fix)

This commit is contained in:
Roman Shevchenko
2016-10-09 10:52:04 +02:00
parent 90d23de459
commit f2a089bc51
2 changed files with 6 additions and 2 deletions
@@ -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
@@ -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