Skip to content

Commit

Permalink
make extensions final/non-public
Browse files Browse the repository at this point in the history
  • Loading branch information
YannCebron committed May 8, 2024
1 parent f9d2fc5 commit 67cd826
Show file tree
Hide file tree
Showing 66 changed files with 156 additions and 175 deletions.
4 changes: 2 additions & 2 deletions src/org/intellij/grammar/BnfASTFactory.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2011-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2011-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/

package org.intellij.grammar;
Expand All @@ -14,7 +14,7 @@
/**
* @author gregsh
*/
public class BnfASTFactory extends ASTFactory {
final class BnfASTFactory extends ASTFactory {

@Override
public @Nullable CompositeElement createComposite(@NotNull IElementType type) {

Check warning on line 20 in src/org/intellij/grammar/BnfASTFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Nullability and data flow problems

@nullable method 'createComposite' always returns a non-null value
Expand Down
4 changes: 2 additions & 2 deletions src/org/intellij/grammar/BnfBraceMatcher.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2011-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2011-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/
package org.intellij.grammar;

Expand All @@ -14,7 +14,7 @@
/**
* @author gregsh
*/
public class BnfBraceMatcher implements PairedBraceMatcher {
public final class BnfBraceMatcher implements PairedBraceMatcher {

private static final BracePair[] PAIRS = new BracePair[]{
new BracePair(BnfTypes.BNF_LEFT_PAREN, BnfTypes.BNF_RIGHT_PAREN, false),
Expand Down
4 changes: 2 additions & 2 deletions src/org/intellij/grammar/BnfCommenter.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2011-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2011-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/
package org.intellij.grammar;

Expand All @@ -10,7 +10,7 @@
/**
* @author gregsh
*/
public class BnfCommenter implements CodeDocumentationAwareCommenter {
final class BnfCommenter implements CodeDocumentationAwareCommenter {
@Override
public String getLineCommentPrefix() {
return "//";
Expand Down
6 changes: 3 additions & 3 deletions src/org/intellij/grammar/BnfCompletionContributor.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2011-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2011-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/

package org.intellij.grammar;
Expand Down Expand Up @@ -43,9 +43,9 @@
/**
* @author gregsh
*/
public class BnfCompletionContributor extends CompletionContributor {
final class BnfCompletionContributor extends CompletionContributor {

public BnfCompletionContributor() {
BnfCompletionContributor() {
PsiElementPattern.Capture<PsiElement> placePattern =
psiElement()
.inFile(StandardPatterns.instanceOf(BnfFile.class))
Expand Down
4 changes: 2 additions & 2 deletions src/org/intellij/grammar/BnfDescriptionProvider.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2011-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2011-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/
package org.intellij.grammar;

Expand All @@ -24,7 +24,7 @@
* @author gregory
* Date: 17.07.11 18:46
*/
public class BnfDescriptionProvider implements ElementDescriptionProvider {
final class BnfDescriptionProvider implements ElementDescriptionProvider {
@Override
public String getElementDescription(@NotNull PsiElement psiElement, @NotNull ElementDescriptionLocation location) {
if (location == UsageViewNodeTextLocation.INSTANCE && psiElement instanceof BnfComposite) {
Expand Down
4 changes: 2 additions & 2 deletions src/org/intellij/grammar/BnfDocumentationProvider.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2011-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2011-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/

package org.intellij.grammar;
Expand Down Expand Up @@ -30,7 +30,7 @@
/**
* @author gregsh
*/
public class BnfDocumentationProvider implements DocumentationProvider {
final class BnfDocumentationProvider implements DocumentationProvider {

@Override
public @Nullable String getQuickNavigateInfo(PsiElement element, PsiElement originalElement) {
Expand Down
6 changes: 3 additions & 3 deletions src/org/intellij/grammar/BnfFileType.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2011-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2011-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/
package org.intellij.grammar;

Expand All @@ -14,11 +14,11 @@
* Date: 13.07.11
* Time: 22:46
*/
public class BnfFileType extends LanguageFileType {
public final class BnfFileType extends LanguageFileType {

public static final BnfFileType INSTANCE = new BnfFileType();

protected BnfFileType() {
private BnfFileType() {
super(BnfLanguage.INSTANCE);
}

Expand Down
4 changes: 2 additions & 2 deletions src/org/intellij/grammar/BnfFindUsagesProvider.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2011-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2011-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/
package org.intellij.grammar;

Expand All @@ -17,7 +17,7 @@
/**
* @author gregsh
*/
public class BnfFindUsagesProvider implements FindUsagesProvider {
final class BnfFindUsagesProvider implements FindUsagesProvider {
@Override
public WordsScanner getWordsScanner() {
return null;
Expand Down
4 changes: 2 additions & 2 deletions src/org/intellij/grammar/BnfFoldingBuilder.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2011-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2011-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/

package org.intellij.grammar;
Expand All @@ -19,7 +19,7 @@
/**
* @author gregsh
*/
public class BnfFoldingBuilder extends CustomFoldingBuilder {
final class BnfFoldingBuilder extends CustomFoldingBuilder {

@Override
protected void buildLanguageFoldRegions(@NotNull List<FoldingDescriptor> result,
Expand Down
4 changes: 2 additions & 2 deletions src/org/intellij/grammar/BnfStructureViewFactory.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2011-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2011-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/

package org.intellij.grammar;
Expand Down Expand Up @@ -29,7 +29,7 @@
/**
* @author gregsh
*/
public class BnfStructureViewFactory implements PsiStructureViewFactory {
final class BnfStructureViewFactory implements PsiStructureViewFactory {
@Override
public StructureViewBuilder getStructureViewBuilder(@NotNull PsiFile psiFile) {
return new TreeBasedStructureViewBuilder() {
Expand Down
8 changes: 4 additions & 4 deletions src/org/intellij/grammar/diagram/BnfDiagramProvider.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2011-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2011-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/

package org.intellij.grammar.diagram;
Expand Down Expand Up @@ -44,8 +44,8 @@
/**
* @author gregsh
*/
public class BnfDiagramProvider extends DiagramProvider<BnfRule> {
public static final String ID = "GRAMMAR";
final class BnfDiagramProvider extends DiagramProvider<BnfRule> {
private static final String ID = "GRAMMAR";

private record Item(BnfRule rule, RuleGraphHelper.Cardinality cardinality) {
}
Expand Down Expand Up @@ -164,7 +164,7 @@ public BnfRule resolveElementByFQN(@NotNull String s, @NotNull Project project)
private final DiagramExtras<BnfRule> myExtras = new DiagramExtras<>();
private RuleGraphHelper myGraphHelper;

public BnfDiagramProvider() {
BnfDiagramProvider() {
myElementManager.setUmlProvider(this);
}

Expand Down
4 changes: 2 additions & 2 deletions src/org/intellij/grammar/editor/BnfAnnotator.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2011-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2011-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/
package org.intellij.grammar.editor;

Expand Down Expand Up @@ -28,7 +28,7 @@
/**
* @author gregsh
*/
public class BnfAnnotator implements Annotator, DumbAware {
final class BnfAnnotator implements Annotator, DumbAware {
@Override
public void annotate(@NotNull PsiElement psiElement, @NotNull AnnotationHolder annotationHolder) {
PsiElement parent = psiElement.getParent();
Expand Down
4 changes: 2 additions & 2 deletions src/org/intellij/grammar/editor/BnfColorSettingsPage.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2011-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2011-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/

package org.intellij.grammar.editor;
Expand All @@ -23,7 +23,7 @@
/**
* @author gregsh
*/
public class BnfColorSettingsPage implements ColorSettingsPage {
final class BnfColorSettingsPage implements ColorSettingsPage {
private static final AttributesDescriptor[] ATTRS;

static {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2011-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2011-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/
package org.intellij.grammar.editor;

Expand All @@ -12,7 +12,7 @@
/**
* @author gregsh
*/
public class BnfExpressionMarkerAnnotator implements Annotator {
final class BnfExpressionMarkerAnnotator implements Annotator {
@Override
public void annotate(@NotNull PsiElement psiElement, @NotNull AnnotationHolder annotationHolder) {
if (!(psiElement instanceof BnfRule)) return;
Expand Down
4 changes: 2 additions & 2 deletions src/org/intellij/grammar/editor/BnfMoveLeftRightHandler.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2011-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2011-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/
package org.intellij.grammar.editor;

Expand All @@ -11,7 +11,7 @@
import java.util.Collections;
import java.util.List;

public class BnfMoveLeftRightHandler extends MoveElementLeftRightHandler {
final class BnfMoveLeftRightHandler extends MoveElementLeftRightHandler {

@Override
public PsiElement @NotNull [] getMovableSubElements(@NotNull PsiElement element) {
Expand Down
4 changes: 2 additions & 2 deletions src/org/intellij/grammar/editor/BnfPinMarkerAnnotator.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2011-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2011-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/

package org.intellij.grammar.editor;
Expand Down Expand Up @@ -28,7 +28,7 @@
/**
* @author gregsh
*/
public class BnfPinMarkerAnnotator implements Annotator, DumbAware {
final class BnfPinMarkerAnnotator implements Annotator, DumbAware {
@Override
public void annotate(@NotNull PsiElement psiElement, @NotNull AnnotationHolder annotationHolder) {
if (!(psiElement instanceof BnfRule)) return;
Expand Down
6 changes: 3 additions & 3 deletions src/org/intellij/grammar/editor/BnfQuoteHandler.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2011-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2011-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/

package org.intellij.grammar.editor;
Expand All @@ -11,8 +11,8 @@
/**
* @author gregsh
*/
public class BnfQuoteHandler extends SimpleTokenSetQuoteHandler {
public BnfQuoteHandler() {
final class BnfQuoteHandler extends SimpleTokenSetQuoteHandler {
BnfQuoteHandler() {
super(BnfTypes.BNF_STRING, TokenType.BAD_CHARACTER);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2011-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2011-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/

package org.intellij.grammar.editor;
Expand All @@ -25,7 +25,7 @@
/**
* @author gregsh
*/
public class BnfRecursionLineMarkerProvider implements LineMarkerProvider {
final class BnfRecursionLineMarkerProvider implements LineMarkerProvider {
@Override
public @Nullable LineMarkerInfo<?> getLineMarkerInfo(@NotNull PsiElement element) {
return null;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2011-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2011-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/

package org.intellij.grammar.editor;
Expand Down Expand Up @@ -32,7 +32,7 @@
/**
* @author gregsh
*/
public class BnfRuleLineMarkerProvider extends RelatedItemLineMarkerProvider {
final class BnfRuleLineMarkerProvider extends RelatedItemLineMarkerProvider {

@Override
public void collectNavigationMarkers(@NotNull List<? extends PsiElement> elements,
Expand Down
4 changes: 2 additions & 2 deletions src/org/intellij/grammar/editor/BnfSpellCheckingStrategy.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2011-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2011-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/

package org.intellij.grammar.editor;
Expand All @@ -12,7 +12,7 @@
/**
* @author gregsh
*/
public class BnfSpellCheckingStrategy extends SpellcheckingStrategy {
final class BnfSpellCheckingStrategy extends SpellcheckingStrategy {
@Override
public @NotNull Tokenizer<?> getTokenizer(PsiElement element) {
return super.getTokenizer(element);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2011-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2011-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/
package org.intellij.grammar.editor;

Expand All @@ -15,7 +15,7 @@
* Date: 14.07.11
* Time: 13:25
*/
public class BnfSyntaxHighlighterFactory extends SyntaxHighlighterFactory {
final class BnfSyntaxHighlighterFactory extends SyntaxHighlighterFactory {
@Override
public @NotNull SyntaxHighlighter getSyntaxHighlighter(Project project, VirtualFile virtualFile) {
return new BnfSyntaxHighlighter();
Expand Down
4 changes: 2 additions & 2 deletions src/org/intellij/grammar/editor/BnfWordSelectioner.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2011-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2011-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/

package org.intellij.grammar.editor;
Expand All @@ -18,7 +18,7 @@
/**
* @author gregsh
*/
public class BnfWordSelectioner extends BraceMatcherBasedSelectioner{
final class BnfWordSelectioner extends BraceMatcherBasedSelectioner{
@Override
public boolean canSelect(@NotNull PsiElement e) {
return e instanceof BnfComposite ||
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2011-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2011-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/

package org.intellij.grammar.inspection;
Expand All @@ -24,7 +24,7 @@
*
* @author Vadim Romansky
*/
public class BnfDuplicateRuleInspection extends LocalInspectionTool {
final class BnfDuplicateRuleInspection extends LocalInspectionTool {

@Override
public ProblemDescriptor[] checkFile(@NotNull PsiFile file, @NotNull InspectionManager manager, boolean isOnTheFly) {
Expand Down
Loading

0 comments on commit 67cd826

Please sign in to comment.