Cleanup (deprecated API; typos; formatting)

GitOrigin-RevId: 704e0c85ebda1d48ab91185286b9cd6dfc6990f9
This commit is contained in:
Roman Shevchenko
2025-10-09 22:31:07 +00:00
committed by intellij-monorepo-bot
parent 7741f354e6
commit e67900b6bd
7 changed files with 361 additions and 332 deletions
@@ -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.openapi.command.WriteCommandAction;
@@ -76,7 +76,7 @@ public class ComplexUndoTest extends EditorUndoTestCase {
public void testDoesNotLoseCharset() {
char utf8character = '\u00e9';
EditorTestUtil.saveEncodingsIn(myProject, null, WINDOWS_1251, () -> PlatformTestUtil.withEncoding(WINDOWS_1251.name(), () -> {
EditorTestUtil.saveEncodingsIn(myProject, null, WINDOWS_1251, () -> PlatformTestUtil.withEncoding(WINDOWS_1251, () -> {
assertEquals(CharsetToolkit.UTF8, EncodingManager.getInstance().getDefaultCharsetName());
VirtualFile virtualFile = createFileInCommand("f.java");
VirtualFile virtualFile2 = createFileInCommand("g.java");
@@ -121,4 +121,4 @@ public class ComplexUndoTest extends EditorUndoTestCase {
checkEditorText(text, e);
}
}
}
}
@@ -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.highlighter;
import com.intellij.core.CoreBundle;
@@ -13,8 +13,7 @@ import javax.swing.*;
public class ArchiveFileType implements FileType {
public static final ArchiveFileType INSTANCE = new ArchiveFileType();
protected ArchiveFileType() {
}
protected ArchiveFileType() { }
@Override
public @NotNull String getName() {
@@ -27,7 +26,7 @@ public class ArchiveFileType implements FileType {
}
@Override
public @Nls @NotNull String getDisplayName() {
public @NotNull @Nls String getDisplayName() {
return CoreBundle.message("filetype.archive.display.name");
}
@@ -1,9 +1,9 @@
// 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.io
import com.intellij.jna.JnaLoader
import com.intellij.openapi.diagnostic.logger
import com.intellij.openapi.util.SystemInfo
import com.intellij.util.system.OS
import com.sun.jna.Structure
import com.sun.jna.platform.unix.LibC
import com.sun.jna.platform.win32.*
@@ -17,9 +17,8 @@ object SuperUserStatus {
try {
when {
!JnaLoader.isLoaded() -> false
SystemInfo.isWindows -> WindowsElevationStatus.isElevated()
SystemInfo.isUnix -> UnixUserStatus.isSuperUser()
else -> false
OS.CURRENT == OS.Windows -> WindowsElevationStatus.isElevated()
else -> UnixUserStatus.isSuperUser()
}
}
catch (t: Throwable) {
File diff suppressed because it is too large Load Diff
@@ -1,10 +1,9 @@
// 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.util.text;
import com.intellij.util.ArrayUtilRt;
import com.intellij.util.Function;
import com.intellij.util.text.CharArrayCharSequence;
import com.intellij.util.text.CharSequenceSubSequence;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -786,4 +785,4 @@ public final class Strings {
public static boolean areSameInstance(@Nullable String s1, @Nullable String s2) {
return s1 == s2;
}
}
}
@@ -84,7 +84,7 @@ public class PropertiesCharsetTest extends JavaCodeInsightTestCase {
EncodingProjectManager.getInstance(getProject()).setNative2AsciiForPropertiesFiles(null, false);
EncodingProjectManager.getInstance(getProject()).setDefaultCharsetForPropertiesFiles(null, StandardCharsets.ISO_8859_1);
PlatformTestUtil.withEncoding("UTF-8", () -> {
PlatformTestUtil.withEncoding(StandardCharsets.UTF_8, () -> {
configureByText("\\u1234\\uxxxx\\n\\t\\y=\\u3210\\uzzzz\\n\\t\\y");
List<IProperty> properties = ((PropertiesFile)myFile).getProperties();
assertEquals(1, properties.size());
@@ -110,7 +110,7 @@ public class PropertiesCharsetTest extends JavaCodeInsightTestCase {
EncodingProjectManager.getInstance(getProject()).setDefaultCharsetForPropertiesFiles(null, null);
EncodingProjectManager.getInstance(getProject()).setEncoding(null, StandardCharsets.UTF_8);
PlatformTestUtil.withEncoding("UTF-8", () -> {
PlatformTestUtil.withEncoding(StandardCharsets.UTF_8, () -> {
configureByText("\\u1234\\uxxxx\\n\\t\\y=\\u3210\\uzzzz\\n\\t\\y");
List<IProperty> properties = ((PropertiesFile)myFile).getProperties();
assertEquals(1, properties.size());
@@ -1,4 +1,4 @@
// Copyright 2000-2019 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.codeInsight.editorActions;
import com.intellij.testFramework.PlatformTestUtil;
@@ -89,10 +89,10 @@ public class EscapeEntitiesActionTest extends LightJavaCodeInsightFixtureTestCas
private void doTest(String text, final String extension, final String expected) {
String finalText = !text.contains("<selection>") ? "<selection>" + text + "</selection>" : text;
PlatformTestUtil.withEncoding("UTF-8", () -> {
PlatformTestUtil.withEncoding(StandardCharsets.UTF_8, () -> {
myFixture.configureByText(getTestName(true) + "." + extension, finalText);
myFixture.performEditorAction("EscapeEntities");
myFixture.checkResult(expected);
});
}
}
}