Skip to content

Commit

Permalink
cleanup (final, visibility)
Browse files Browse the repository at this point in the history
GitOrigin-RevId: 8faa58a751c19a553c1ba09763e56795cb36ed38
  • Loading branch information
develar authored and intellij-monorepo-bot committed Jan 31, 2025
1 parent 8ba1e0d commit f112101
Show file tree
Hide file tree
Showing 138 changed files with 422 additions and 528 deletions.
5 changes: 2 additions & 3 deletions grid/core-impl/src/extractors/ScriptDataExtractor.java
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ public void complete() {
}
}

class DataStreamImpl extends DataStream<DataRowImpl> {
final class DataStreamImpl extends DataStream<DataRowImpl> {
final AtomicReference<Iterator<DataRowImpl>> iterator = new AtomicReference<>(new Iterator<>() {
@Override
public boolean hasNext() {
Expand All @@ -255,7 +255,6 @@ void close(@Nullable Throwable error) {
}
}


private final Queue<RowUpdate> myRowsQueue = new ArrayDeque<>();
private boolean myRowsDequeued;
private boolean myAllRowsLoaded;
Expand Down Expand Up @@ -365,7 +364,7 @@ private synchronized void doWait() {
}
}

static class RowUpdate {
static final class RowUpdate {
final GridRow myRow;
final List<? extends DataColumn> myAllColumnsUpdate;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.idea.customization.base

import com.intellij.openapi.util.SystemInfo
import com.intellij.openapi.util.SystemInfoRt
import com.intellij.platform.ide.impl.customization.BaseJetBrainsExternalProductResourceUrls
import com.intellij.util.Url
import com.intellij.util.Urls
Expand Down Expand Up @@ -30,7 +30,7 @@ class IntelliJIdeaExternalResourceUrls : BaseJetBrainsExternalProductResourceUrl

override val keyboardShortcutsPdfUrl: Url
get() {
val suffix = if (SystemInfo.isMac) "_Mac" else ""
val suffix = if (SystemInfoRt.isMac) "_Mac" else ""
return Urls.newFromEncoded("https://www.jetbrains.com/idea/docs/IntelliJIDEA_ReferenceCard$suffix.pdf")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import com.intellij.openapi.actionSystem.ActionGroup
import javax.swing.Icon
import javax.swing.JComponent

class CompilationChartsBuildEvent(val view: BuildViewManager,
internal class CompilationChartsBuildEvent(val view: BuildViewManager,
val buildId: Any,
val chart: CompilationCharts) :
AbstractBuildEvent(Any(), buildId, System.currentTimeMillis(), CompilationChartsBundle.message("charts.tab.name")),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2000-2021 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 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.compiler.impl

import com.intellij.notification.Notification
Expand All @@ -25,7 +25,7 @@ class CompileDriverNotifications(

companion object {
@JvmStatic
fun getInstance(project: Project) = project.service<CompileDriverNotifications>()
fun getInstance(project: Project): CompileDriverNotifications = project.service<CompileDriverNotifications>()
}

override fun dispose() {
Expand All @@ -45,13 +45,15 @@ class CompileDriverNotifications(
.setImportant(true)

fun withExpiringAction(@NotificationContent title : String,
handler: () -> Unit) = apply {
baseNotification.addAction(NotificationAction.createSimpleExpiring(title, handler))
handler: () -> Unit): LightNotification {
return apply {
baseNotification.addAction(NotificationAction.createSimpleExpiring(title, handler))
}
}

@JvmOverloads
fun withOpenSettingsAction(moduleNameToSelect: String? = null, tabNameToSelect: String? = null) =
withExpiringAction(JavaCompilerBundle.message("notification.action.jps.open.configuration.dialog")) {
fun withOpenSettingsAction(moduleNameToSelect: String? = null, tabNameToSelect: String? = null): LightNotification {
return withExpiringAction(JavaCompilerBundle.message("notification.action.jps.open.configuration.dialog")) {
val service = ProjectSettingsService.getInstance(project)
if (moduleNameToSelect != null) {
service.showModuleConfigurationDialog(moduleNameToSelect, tabNameToSelect)
Expand All @@ -60,6 +62,7 @@ class CompileDriverNotifications(
service.openProjectSettings()
}
}
}

fun withContent(@NotificationContent content: String): LightNotification = apply {
baseNotification.setContent(content)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.compiler.inspection;

import com.intellij.CommonBundle;
Expand Down Expand Up @@ -32,7 +32,7 @@
import java.util.Set;
import java.util.stream.Collectors;

public class ChangeSuperClassFix implements LocalQuickFix, HighPriorityAction {
public final class ChangeSuperClassFix implements LocalQuickFix, HighPriorityAction {
private final @NotNull SmartPsiElementPointer<PsiClass> myNewSuperClass;
private final @NotNull SmartPsiElementPointer<PsiClass> myOldSuperClass;
private final int myInheritorCount;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.openapi.compiler.util;

import com.intellij.codeHighlighting.HighlightDisplayLevel;
Expand Down Expand Up @@ -40,7 +40,7 @@
import java.io.IOException;
import java.util.*;

public class InspectionValidatorWrapper implements Validator {
public final class InspectionValidatorWrapper implements Validator {
private final InspectionValidator myValidator;
private final PsiManager myPsiManager;
private final CompilerManager myCompilerManager;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.compiler;

import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer;
Expand All @@ -7,7 +7,7 @@
import com.intellij.codeInspection.options.OptionControllerProvider;
import com.intellij.openapi.compiler.JavaCompilerBundle;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleUtil;
import com.intellij.openapi.module.ModuleUtilCore;
import com.intellij.openapi.project.Project;
import com.intellij.psi.JavaCompilerConfigurationProxy;
import com.intellij.psi.PsiElement;
Expand All @@ -17,7 +17,7 @@
import java.util.List;
import java.util.Objects;

public final class JavaCompilerConfiguration extends JavaCompilerConfigurationProxy {
final class JavaCompilerConfiguration extends JavaCompilerConfigurationProxy {
@Override
public @NotNull List<String> getAdditionalOptionsImpl(@NotNull Project project, @NotNull Module module) {
return CompilerConfiguration.getInstance(project).getAdditionalOptions(module);
Expand All @@ -31,12 +31,12 @@ public void setAdditionalOptionsImpl(@NotNull Project project, @NotNull Module m
/**
* Provides an option "JavaCompilerConfiguration.additionalOptions" to change module-specific compiler options
*/
public static final class Provider implements OptionControllerProvider {
static final class Provider implements OptionControllerProvider {

@SuppressWarnings({"InjectedReferences", "LanguageMismatch"})
@Override
public @NotNull OptionController forContext(@NotNull PsiElement context) {
Module module = Objects.requireNonNull(ModuleUtil.findModuleForFile(context.getContainingFile()));
Module module = Objects.requireNonNull(ModuleUtilCore.findModuleForFile(context.getContainingFile()));
Project project = module.getProject();
String bindId = "additionalOptions";
return OptionController.empty()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
// Copyright 2000-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 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.execution.filters;

import com.intellij.execution.filters.Filter.ResultItem;
import com.intellij.openapi.roots.ProjectRootManager;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.PsiClass;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.List;

public final class NavigateToExceptionClassFilter implements JvmExceptionOccurrenceFilter {
@Override
public @Nullable ResultItem applyFilter(@NotNull String exceptionClassName,
@NotNull List<PsiClass> classes,
int exceptionStartOffset) {
public @NotNull ResultItem applyFilter(@NotNull String exceptionClassName,
@NotNull List<PsiClass> classes,
int exceptionStartOffset) {
PsiClass psiClass = classes.get(0);
boolean inContent =
ProjectRootManager.getInstance(psiClass.getProject()).getFileIndex().isInContent(psiClass.getContainingFile().getVirtualFile());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.ide.java.training

import com.intellij.java.ift.JavaLessonsBundle
Expand All @@ -9,7 +9,7 @@ import com.intellij.util.PlatformUtils
import training.ui.welcomeScreen.OnboardingLessonPromoter
import javax.swing.Icon

class JavaOnboardingTourPromoter : OnboardingLessonPromoter(
private class JavaOnboardingTourPromoter : OnboardingLessonPromoter(
ideaOnboardingLessonId, javaLanguageId, JavaLessonsBundle.message("java.onboarding.lesson.name")
) {
override val promoImage: Icon
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.codeInspection.java19api;

import com.intellij.codeInsight.daemon.impl.analysis.JavaModuleGraphUtil;
Expand All @@ -16,13 +16,12 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jps.model.java.JavaSourceRootProperties;
import org.jetbrains.jps.model.java.JavaSourceRootType;
import org.jetbrains.jps.model.module.JpsModuleSourceRoot;

import java.util.*;

import static org.jetbrains.jps.model.java.JavaSourceRootType.SOURCE;

class ModuleNode implements Comparable<ModuleNode> {
final class ModuleNode implements Comparable<ModuleNode> {
private final @Nullable Module myModule;
private final @NotNull Set<String> myDeclaredPackages;
private final @NotNull Set<String> myRequiredPackages;
Expand Down Expand Up @@ -146,7 +145,7 @@ PsiDirectory getRootDir() {

private static boolean isSourceFolder(@NotNull SourceFolder folder) {
final JpsModuleSourceRoot sourceRoot = folder.getJpsElement();
if (sourceRoot.getRootType() != SOURCE) return false;
if (sourceRoot.getRootType() != JavaSourceRootType.SOURCE) return false;
if (!(sourceRoot.getProperties() instanceof JavaSourceRootProperties javaProperties)) return false;
return !javaProperties.isForGeneratedSources();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.refactoring.changeSignature;

import com.intellij.lang.java.JavaLanguage;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.util.Comparing;
import com.intellij.psi.*;
import com.intellij.psi.impl.light.LightRecordCanonicalConstructor;
Expand Down Expand Up @@ -32,9 +31,8 @@
/**
* @author Maxim.Medvedev
*/
class JavaChangeSignatureUsageSearcher {
final class JavaChangeSignatureUsageSearcher {
private final JavaChangeInfo myChangeInfo;
private static final Logger LOG = Logger.getInstance(JavaChangeSignatureUsageSearcher.class);

JavaChangeSignatureUsageSearcher(JavaChangeInfo changeInfo) {
this.myChangeInfo = changeInfo;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.refactoring.typeMigration.ui;

import com.intellij.ide.projectView.TreeStructureProvider;
Expand All @@ -9,10 +9,7 @@
import java.util.Collections;
import java.util.List;

/**
* @author anna
*/
public class TypeMigrationTreeStructure extends AbstractTreeStructureBase {
public final class TypeMigrationTreeStructure extends AbstractTreeStructureBase {
private MigrationRootNode myRoot;

public TypeMigrationTreeStructure(final Project project) {
Expand All @@ -35,7 +32,6 @@ public List<TreeStructureProvider> getProviders() {

@Override
public void commit() {

}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.codeInsight.completion.commands.impl

import com.intellij.analysis.AnalysisBundle.message
Expand All @@ -21,7 +21,7 @@ import kotlinx.coroutines.job
import org.jetbrains.annotations.Nls
import javax.swing.Icon

class DirectErrorFixCompletionCommand(
internal class DirectErrorFixCompletionCommand(
override val name: @Nls String,
override val priority: Int?,
override val icon: Icon?,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.codeInsight.folding.impl;

import com.intellij.psi.JavaTokenType;
Expand All @@ -8,7 +8,7 @@
import com.intellij.psi.util.PsiTreeUtil;
import org.jetbrains.annotations.Nullable;

public final class JavaCollapseBlockHandler extends CollapseBlockHandlerImpl {
final class JavaCollapseBlockHandler extends CollapseBlockHandlerImpl {
@Override
protected @Nullable PsiElement findParentBlock(@Nullable PsiElement element) {
return PsiTreeUtil.getParentOfType(element, PsiCodeBlock.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

import java.util.*;


public final class JavaUsageTypeProvider implements UsageTypeProviderEx {
@Override
public UsageType getUsageType(final @NotNull PsiElement element) {
Expand All @@ -35,10 +34,9 @@ public UsageType getUsageType(@NotNull PsiElement element, UsageTarget @NotNull
}

private static @Nullable UsageType getMethodUsageType(PsiElement element) {
if (element instanceof PsiReferenceExpression) {
if (element instanceof PsiReferenceExpression referenceExpression) {
final PsiMethod containerMethod = PsiTreeUtil.getParentOfType(element, PsiMethod.class);
if (containerMethod != null) {
final PsiReferenceExpression referenceExpression = (PsiReferenceExpression)element;
final PsiExpression qualifier = referenceExpression.getQualifierExpression();
final PsiElement p = referenceExpression.getParent();
if (p instanceof PsiMethodCallExpression callExpression) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.util.xml;

import com.intellij.psi.*;
Expand All @@ -11,7 +11,7 @@
import java.util.Arrays;
import java.util.List;

public class JvmPsiTypeConverterImpl extends JvmPsiTypeConverter implements CustomReferenceConverter<PsiType> {
public final class JvmPsiTypeConverterImpl extends JvmPsiTypeConverter implements CustomReferenceConverter<PsiType> {

private static final BidirectionalMap<PsiType, Character> ourPrimitiveTypes = new BidirectionalMap<>();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.ide.structureView.impl.java;

import com.intellij.ide.util.InheritedMembersNodeProvider;
Expand All @@ -12,7 +12,7 @@
/**
* @author Konstantin Bulenkov
*/
public class JavaInheritedMembersNodeProvider extends InheritedMembersNodeProvider {
public final class JavaInheritedMembersNodeProvider extends InheritedMembersNodeProvider {
@Override
public @NotNull Collection<TreeElement> provideNodes(@NotNull TreeElement node) {
if (!(node instanceof JavaClassTreeElement classNode)) return Collections.emptyList();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2000-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 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.openapi.command.undo;

import com.intellij.codeInsight.JavaCodeInsightTestCase;
Expand All @@ -16,7 +16,6 @@
import com.intellij.openapi.fileEditor.FileEditor;
import com.intellij.openapi.fileEditor.FileEditorManager;
import com.intellij.openapi.fileEditor.OpenFileDescriptor;
import com.intellij.openapi.fileEditor.impl.CurrentEditorProvider;
import com.intellij.openapi.fileEditor.impl.text.TextEditorProvider;
import com.intellij.openapi.util.ThrowableComputable;
import com.intellij.openapi.vfs.VirtualFile;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
// Copyright 2000-2021 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 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.openapi.editor;

import com.intellij.openapi.editor.colors.TextAttributesKey;


public final class JspHighlighterColors {
private JspHighlighterColors() { }

Expand Down
Loading

0 comments on commit f112101

Please sign in to comment.