mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[java] unnecessary semicolons in module-info files
This commit is contained in:
+6
@@ -114,6 +114,12 @@ public class UnnecessarySemicolonInspection extends BaseInspection implements Cl
|
||||
super.visitImportList(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visitModule(PsiJavaModule module) {
|
||||
findTopLevelSemicolons(module);
|
||||
super.visitModule(module);
|
||||
}
|
||||
|
||||
private void findTopLevelSemicolons(PsiElement element) {
|
||||
for (PsiElement sibling = element.getFirstChild(); sibling != null; sibling = skipForwardWhiteSpacesAndComments(sibling)) {
|
||||
if (PsiUtil.isJavaToken(sibling, JavaTokenType.SEMICOLON)) {
|
||||
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
module M {
|
||||
<warning descr="Unnecessary semicolon ';'">;</warning>
|
||||
}
|
||||
+9
@@ -16,11 +16,20 @@
|
||||
package com.siyeh.ig.style;
|
||||
|
||||
import com.intellij.codeInspection.InspectionProfileEntry;
|
||||
import com.intellij.testFramework.LightProjectDescriptor;
|
||||
import com.siyeh.ig.LightInspectionTestCase;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class UnnecessarySemicolonInspectionTest extends LightInspectionTestCase {
|
||||
public void testUnnecessarySemicolon() { doTest(); }
|
||||
public void testModuleInfo() { doNamedTest("module-info"); }
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected LightProjectDescriptor getProjectDescriptor() {
|
||||
return JAVA_9;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user