Skip to content

Commit

Permalink
mark classes final
Browse files Browse the repository at this point in the history
GitOrigin-RevId: 6414b6f2119c82c7567987dd30b35cab5491d9e2
  • Loading branch information
develar authored and intellij-monorepo-bot committed Dec 30, 2022
1 parent 2f9def0 commit 2fbf494
Show file tree
Hide file tree
Showing 254 changed files with 295 additions and 357 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import java.util.Locale;
import org.jetbrains.annotations.NotNull;

public class NumberFormatter {
public final class NumberFormatter {

private static final Format INTEGER_FORMAT = NumberFormat.getIntegerInstance();
private static final String[] FILE_SIZE_UNITS = {"B", "KB", "MB", "GB", "TB", "PB", "EB"};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import java.text.DecimalFormat;
import java.util.concurrent.TimeUnit;

public class TimeFormatter {
public final class TimeFormatter {

/**
* Return a formatted time String in the form of "hh:mm:ss.sss".
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
* Utilities related to image processing.
*/
@SuppressWarnings("UndesirableClassUsage") // BufferedImage is ok, deliberately not creating Retina images in some cases
public class ImageUtils {
public final class ImageUtils {
public static final double EPSILON = 1e-5;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package com.android.tools.adtui.chart.hchart;

public class Separators {
public final class Separators {
public static final String JAVA_CODE = ".";
public static final String NATIVE_CODE = "::";
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import java.util.Set;
import org.jetbrains.annotations.NotNull;

public class FontUtil {
public final class FontUtil {
@NotNull
public static Font getFontAbleToDisplay(@NotNull String s, @NotNull Font defaultFont) {
if (SystemInfo.isMac // On Macs, all fonts can display all the characters because the system renders using fallback fonts.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/**
* Utilities for {@link com.intellij.openapi.ui.ThreeComponentsSplitter}.
*/
public class SplitterUtil {
public final class SplitterUtil {

public static void setMinimumWidth(@NotNull JComponent component, int minWidth) {
Dimension minimumSize = component.getMinimumSize();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
/**
* Standard UI color constants used in various components.
*/
public class StandardColors {
public final class StandardColors {
public static final Color INNER_BORDER_COLOR = new JBColor(0xBEBEBE, 0x646464);
public static final Color FOCUSED_INNER_BORDER_COLOR = new JBColor(0x90AADC, 0x5781C6);
public static final Color FOCUSED_OUTER_BORDER_COLOR = new JBColor(0xB2CCFB, 0x395D82);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
* The paint methods here are extract from the private method equivalents inside {@link javax.swing.plaf.basic.BasicMenuUI} and
* {@link javax.swing.plaf.basic.BasicMenuItemUI}.
*/
public class CommonMenuPaintHelper {
public final class CommonMenuPaintHelper {

private CommonMenuPaintHelper() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public class ActionToolbarUtil {
public final class ActionToolbarUtil {

// Avoid instantiation...
private ActionToolbarUtil() {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import java.awt.Rectangle;
import java.awt.Shape;

public class GraphicsUtil {
public final class GraphicsUtil {

private static final int BACKGROUND_CELL_SIZE = 4;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import javax.swing.plaf.basic.ComboPopup;
import org.jetbrains.annotations.NotNull;

public class SwingUtil {
public final class SwingUtil {

private static final String DOWN = "selectNext";
private static final String UP = "selectPrevious";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import org.jetbrains.annotations.Nullable;

@SuppressWarnings({"UseJBColor"})
public class MaterialColorUtils {
public final class MaterialColorUtils {

private static final ImmutableMap<Color, String> MATERIAL_NAMES_MAP = ImmutableMap.<Color, String>builder()
.put(MaterialColors.RED_50, "Material Red 50")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/**
* Generates the baseline images for the {@link com.android.tools.adtui.imagediff} package.
*/
class BaselineImagesGenerator {
final class BaselineImagesGenerator {

public static void main(String[] args) {
String resourcesDir;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import org.jetbrains.annotations.Nullable;
import sun.awt.AWTAccessor;

class ComponentAccessor {
final class ComponentAccessor {
public static void setGraphicsConfiguration(@NotNull Component component, @Nullable GraphicsConfiguration gc) {
AWTAccessor.getComponentAccessor().setGraphicsConfiguration(component, gc);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import com.android.tools.adtui.visualtests.threadgraph.ThreadCallsVisualTest;
import javax.swing.SwingUtilities;

public class VisualTests {
public final class VisualTests {

interface Value {
void set(int v);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public class DevicePropertyUtil {
public final class DevicePropertyUtil {
private static final Set<String> ourManufacturerNameIsAcronym =
ImmutableSet.of("ASUS", "HTC", "LG", "LGE", "ZTE");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public class DeviceRenderer {
public final class DeviceRenderer {

// Prevent instantiation
private DeviceRenderer() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
import org.jetbrains.uast.UastContext;
import org.jetbrains.uast.UastUtils;

public class AndroidPsiUtils {
public final class AndroidPsiUtils {
/**
* Looks up the {@link PsiFile} for a given {@link VirtualFile} in a given {@link Project}, in
* a safe way (meaning it will acquire a read lock first, and will check that the file is valid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
/**
* Various utilities for generating user-facing text
*/
public class AndroidTextUtils {
public final class AndroidTextUtils {
// Static utility functions class
private AndroidTextUtils() { }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
/**
* Utility methods used to anonymize information going to the local logs
*/
public class LogAnonymizerUtil {
public final class LogAnonymizerUtil {
private static final String SALT = Integer.toString((new SecureRandom()).nextInt());

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
/**
* File-related methods dependent on the IntelliJ Platform.
*/
public class IdeFileUtils {
public final class IdeFileUtils {
/**
* Returns the Desktop directory for the current user, or {@code null} if it doesn't exist.
* Copied from {@link com.intellij.openapi.fileChooser.actions.GotoDesktopDirAction} with minor changes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import java.io.IOException;
import org.jetbrains.annotations.NotNull;

public class AnonymizerUtil {
public final class AnonymizerUtil {
private static final String ANONYMIZATION_ERROR = "*ANONYMIZATION_ERROR*";
public static final ILogger LOGGER = new LogWrapper(AnonymizerUtil.class);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.android.tools.idea.util;

import com.intellij.ide.plugins.PluginManagerCore;
Expand All @@ -15,7 +16,7 @@
* Code inside Android Studio (as opposed to code inside studio-sdk), should use the methods in this class
* instead of {@link PathManager#getHomePath()} or {@link PluginManagerCore#isRunningFromSources()}.
*/
public class StudioPathManager {
public final class StudioPathManager {

// When running from sources with bundled SDK, the SDK is at:
// $ROOT/tools/idea
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import java.nio.file.Path;
import org.jetbrains.annotations.NotNull;

public class TestDataPathUtils {
public final class TestDataPathUtils {
private static final String TEST_DATA_PATH = "tools/adt/idea/android-common/testData";

public static @NotNull Path getTestDataPath() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

public class MultiDexKeepParserDefinition implements ParserDefinition {

private static class TokenSets {
private static final class TokenSets {
static final TokenSet WHITE_SPACES = TokenSet.create(MultiDexKeepPsiTypes.EOL);
static final TokenSet STRING_LITERALS = TokenSet.create(MultiDexKeepPsiTypes.STRING);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import com.android.tools.idea.lang.multiDexKeep.MultiDexKeepReference;
import com.intellij.psi.PsiReference;

public class PsiImplUtil {
public final class PsiImplUtil {

public static PsiReference getReference(MultiDexKeepClassName className) {
return new MultiDexKeepReference(className);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* Methods for dealing with file paths in a lexical (string-oriented) manner for display of compact
* include paths to the user. Requires that paths in strings use *nix separator.
*/
public class LexicalIncludePaths {
public final class LexicalIncludePaths {
@NotNull
public static final ImmutableSet<String> HEADER_FILE_EXTENSIONS = ImmutableSet.of("", "h", "hpp", "hh", "h++", "hxx", "inl", "tcc", "pch");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
/**
* Utility class for methods involving VirtualFiles.
*/
public class VirtualFiles {
public final class VirtualFiles {

/**
* This method converts a collection of excludes to their equivalent VirtualFile. The result is guaranteed to be a non-null ImmutableList
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
/**
* Methods for creating and dealing with visual representation nodes for include folders.
*/
public class IncludeViewNodes {
public final class IncludeViewNodes {

/**
* Method that produces a collection of folders and files that represents a set of includes in order.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
/**
* Methods for accessing built-in library of images.
*/
public class BuiltInImages {
public final class BuiltInImages {
/** Do not instantiate - all methods are static. */
private BuiltInImages() {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* A set of utility classes for rendering text to a {@link BufferedImage}, suitable for use as a
* source image to {@link IconGenerator} objects.
*/
public class TextRenderUtil {
public final class TextRenderUtil {
/**
* Renders the given string with the provided {@link Options} to a {@link BufferedImage}.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
/**
* Static methods for rendering text as a vector drawable.
*/
public class VectorTextRenderer {
public final class VectorTextRenderer {
private static final String INDENT = " ";
private static final String DOUBLE_INDENT = INDENT + INDENT;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
* The reason the test checks for similarity is that whenever rendering includes fonts, there are some
* platform differences in text rendering etc which does not give us a pixel for pixel match.
*/
public class RenderTestUtil {
public final class RenderTestUtil {
public static final String DEFAULT_DEVICE_ID = "Nexus 4";
public static final String HOLO_THEME = "@android:style/Theme.Holo";
private static final float MAX_PERCENT_DIFFERENT = 1.0f;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
/**
* Collection of utility methods for testing {@link AndroidTestRunConfiguration}s.
*/
public class TestConfigurationTesting {
public final class TestConfigurationTesting {
@Nullable
public static AndroidTestRunConfiguration createAndroidTestConfigurationFromMethod(
@NotNull Project project, @NotNull String qualifiedName, @NotNull String methodName) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
import com.android.tools.idea.projectsystem.ModuleSystemUtil;
import com.android.tools.idea.sdk.IdeSdks;
import com.android.tools.idea.sdk.Jdks;
import com.android.tools.idea.util.StudioPathManager;
import com.google.common.base.Strings;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
Expand Down Expand Up @@ -99,7 +98,7 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public class AndroidGradleTests {
public final class AndroidGradleTests {
private static final Logger LOG = Logger.getInstance(AndroidGradleTests.class);
private static final Pattern REPOSITORIES_PATTERN = Pattern.compile("repositories[ ]+\\{");
private static final Pattern GOOGLE_REPOSITORY_PATTERN = Pattern.compile("google\\(\\)");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,15 @@
import com.intellij.openapi.Disposable;
import com.intellij.openapi.util.Disposer;
import com.intellij.util.ArrayUtil;
import com.intellij.util.ReflectionUtil;
import com.intellij.util.containers.ContainerUtil;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.function.Predicate;
import com.intellij.util.ReflectionUtil;
import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.TestOnly;
Expand All @@ -37,7 +36,7 @@
* Collection of methods for accessing {@link Disposer}'s tree.
*/
@TestOnly
public class DisposerExplorer {
public final class DisposerExplorer {
private static final Object treeLock = getTreeLock();

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
/**
* Utility functions for working with HighlightInfos in a source file
*/
public class HighlightInfos {
public final class HighlightInfos {

/**
* Return a List of all the HighlightInfos in a file filtered by the given predicate (the predicate does not need to check for null as
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

public final class TransportFileManager implements TransportFileCopier {

private static class HostFiles {
private static final class HostFiles {
@NotNull static final DeployableFile TRANSPORT = new DeployableFile.Builder("transport")
.setReleaseDir(Constants.TRANSPORT_RELEASE_DIR)
.setDevDir(Constants.TRANSPORT_RELEASE_DIR)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import org.jetbrains.annotations.NotNull;

public class AvdNameVerifier {
public final class AvdNameVerifier {

private static final String ALLOWED_CHARS = "0-9a-zA-Z-_. ()";
private static final String ALLOWED_CHARS_READABLE = "a-z A-Z 0-9 . _ - ( )";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
/**
* State store keys for the AVD Manager wizards
*/
public class AvdWizardUtils {
public final class AvdWizardUtils {

public static final String WIZARD_ONLY = "AvdManager.WizardOnly.";

Expand Down
Loading

0 comments on commit 2fbf494

Please sign in to comment.