From 89a0440a7e245afe7d95541ac8be660064f4f49b Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Thu, 30 Apr 2015 19:07:58 +0200 Subject: [PATCH] Cleanup (misc. deprecated API dropped from *-api modules) --- .../openapi/module/LanguageLevelUtil.java | 23 +- .../src/com/intellij/psi/PsiType.java | 14 +- .../intellij/psi/util/RedundantCastUtil.java | 8 +- .../libraries/JarVersionDetectionUtil.java | 6 - .../openapi/application/ApplicationInfo.java | 6 - .../openapi/vfs/StandardFileSystems.java | 8 - .../com/intellij/openapi/vfs/VirtualFile.java | 14 +- .../openapi/vfs/VirtualFileSystem.java | 6 - .../openapi/ide/CopyPasteManager.java | 8 +- .../src/com/intellij/formatting/Wrap.java | 20 +- .../openapi/project/ModuleNameTracker.java | 73 ---- .../configurations/GeneralCommandLine.java | 100 ++--- .../process/ColoredProcessHandler.java | 15 +- .../com/intellij/execution/util/ExecUtil.java | 175 +++----- .../util/treeView/AbstractTreeBuilder.java | 13 +- .../com/intellij/lang/LanguageDialect.java | 27 -- .../intellij/openapi/diff/BinaryContent.java | 45 +-- .../com/intellij/openapi/editor/RawText.java | 7 +- .../fileChooser/FileChooserDescriptor.java | 14 +- .../FileChooserDescriptorBuilder.java | 138 ------- .../FileChooserDescriptorFactory.java | 42 +- .../openapi/ui/ComponentWithBrowseButton.java | 11 +- .../intellij/openapi/vfs/LocalFileSystem.java | 9 - .../src/com/intellij/openapi/vfs/VfsUtil.java | 3 - .../wm/PassThroughtIdeFocusManager.java | 20 - .../util/net/HTTPProxySettingsDialog.java | 71 ---- .../util/net/HTTPProxySettingsPanel.java | 32 -- .../openapi/project/ModuleAdapter.java | 8 +- .../util/containers/ContainerUtilRt.java | 6 - .../intellij/util/text/DateFormatUtilRt.java | 33 -- .../openapi/application/PathManager.java | 36 -- .../com/intellij/openapi/diagnostic/Log.java | 56 --- .../com/intellij/openapi/util/JDOMUtil.java | 13 - .../com/intellij/openapi/util/SystemInfo.java | 5 +- .../openapi/util/io/FileSystemUtil.java | 20 - .../intellij/openapi/util/io/FileUtil.java | 18 - .../openapi/util/text/StringUtil.java | 21 - .../com/intellij/util/EnvironmentUtil.java | 14 +- .../util/IncorrectOperationException.java | 7 +- .../com/intellij/util/MemoryDumpHelper.java | 21 +- .../com/intellij/util/cls/BytePointer.java | 27 -- .../src/com/intellij/util/cls/ClsUtil.java | 380 ------------------ .../util/containers/ContainerUtil.java | 7 - .../util/containers/MultiMapBasedOnSet.java | 48 --- .../intellij/util/lang/UrlClassLoader.java | 22 +- .../util/src/com/intellij/util/ui/UIUtil.java | 12 - .../diff/impl/patch/TextFilePatch.java | 32 +- 47 files changed, 148 insertions(+), 1546 deletions(-) delete mode 100644 platform/lang-api/src/com/intellij/openapi/project/ModuleNameTracker.java delete mode 100644 platform/platform-api/src/com/intellij/lang/LanguageDialect.java delete mode 100644 platform/platform-api/src/com/intellij/openapi/fileChooser/FileChooserDescriptorBuilder.java delete mode 100644 platform/platform-api/src/com/intellij/openapi/wm/PassThroughtIdeFocusManager.java delete mode 100644 platform/platform-api/src/com/intellij/util/net/HTTPProxySettingsDialog.java delete mode 100644 platform/platform-api/src/com/intellij/util/net/HTTPProxySettingsPanel.java delete mode 100644 platform/util-rt/src/com/intellij/util/text/DateFormatUtilRt.java delete mode 100644 platform/util/src/com/intellij/openapi/diagnostic/Log.java delete mode 100644 platform/util/src/com/intellij/util/cls/BytePointer.java delete mode 100644 platform/util/src/com/intellij/util/cls/ClsUtil.java delete mode 100644 platform/util/src/com/intellij/util/containers/MultiMapBasedOnSet.java diff --git a/java/java-analysis-api/src/com/intellij/openapi/module/LanguageLevelUtil.java b/java/java-analysis-api/src/com/intellij/openapi/module/LanguageLevelUtil.java index 08d1133608b2..7813c48756d4 100644 --- a/java/java-analysis-api/src/com/intellij/openapi/module/LanguageLevelUtil.java +++ b/java/java-analysis-api/src/com/intellij/openapi/module/LanguageLevelUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,29 +15,8 @@ */ package com.intellij.openapi.module; -import com.intellij.openapi.vfs.VirtualFile; -import com.intellij.pom.java.LanguageLevel; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - /** * @author yole */ public class LanguageLevelUtil extends EffectiveLanguageLevelUtil { - /** - * @deprecated use JavaPsiImplementationHelper#getEffectiveLanguageLevel(com.intellij.openapi.vfs.VirtualFile) - * todo remove in IDEA 15 - */ - @SuppressWarnings({"deprecation", "UnusedDeclaration"}) - @NotNull - public static LanguageLevel getLanguageLevelForFile(@Nullable VirtualFile file) { - if (file == null) return LanguageLevel.HIGHEST; - - if (file.isDirectory()) { - LanguageLevel languageLevel = file.getUserData(LanguageLevel.KEY); - return languageLevel != null ? languageLevel : LanguageLevel.HIGHEST; - } - - return getLanguageLevelForFile(file.getParent()); - } } diff --git a/java/java-psi-api/src/com/intellij/psi/PsiType.java b/java/java-psi-api/src/com/intellij/psi/PsiType.java index 6834e39b2ff6..2eff5ce3388c 100644 --- a/java/java-psi-api/src/com/intellij/psi/PsiType.java +++ b/java/java-psi-api/src/com/intellij/psi/PsiType.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -301,18 +301,6 @@ public abstract class PsiType implements PsiAnnotationOwner { return getAnnotations(); } - /** @deprecated use {@link PsiNameHelper#appendAnnotations(StringBuilder, PsiAnnotation[], boolean)} (to remove in IDEA 14) */ - @SuppressWarnings("UnusedDeclaration") - protected String getAnnotationsTextPrefix(boolean qualified, boolean leadingSpace, boolean trailingSpace) { - PsiAnnotation[] annotations = getAnnotations(); - if (annotations.length == 0) return ""; - - StringBuilder sb = new StringBuilder(); - if (leadingSpace) sb.append(' '); - if (PsiNameHelper.appendAnnotations(sb, annotations, qualified) &&!trailingSpace) sb.setLength(sb.length() - 1); - return sb.toString(); - } - @Override public String toString() { //noinspection HardCodedStringLiteral diff --git a/java/java-psi-api/src/com/intellij/psi/util/RedundantCastUtil.java b/java/java-psi-api/src/com/intellij/psi/util/RedundantCastUtil.java index 94983d4b1396..8ebbc894c7dc 100644 --- a/java/java-psi-api/src/com/intellij/psi/util/RedundantCastUtil.java +++ b/java/java-psi-api/src/com/intellij/psi/util/RedundantCastUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -692,12 +692,6 @@ public class RedundantCastUtil { return result.get().booleanValue(); } - /** @deprecated use {@link #isTypeCastSemantic(PsiTypeCastExpression)} (to remove in IDEA 14) */ - @SuppressWarnings({"UnusedDeclaration", "SpellCheckingInspection"}) - public static boolean isTypeCastSemantical(PsiTypeCastExpression typeCast) { - return isTypeCastSemantic(typeCast); - } - public static boolean isTypeCastSemantic(PsiTypeCastExpression typeCast) { PsiExpression operand = typeCast.getOperand(); if (operand == null) return false; diff --git a/java/openapi/src/com/intellij/openapi/roots/libraries/JarVersionDetectionUtil.java b/java/openapi/src/com/intellij/openapi/roots/libraries/JarVersionDetectionUtil.java index 75f4273bfd60..f6b43ef53a50 100644 --- a/java/openapi/src/com/intellij/openapi/roots/libraries/JarVersionDetectionUtil.java +++ b/java/openapi/src/com/intellij/openapi/roots/libraries/JarVersionDetectionUtil.java @@ -63,10 +63,4 @@ public class JarVersionDetectionUtil { public static String getImplementationVersion(@NotNull File jar) { return JarUtil.getJarAttribute(jar, Attributes.Name.IMPLEMENTATION_VERSION); } - - /** @deprecated use {@link JarUtil#getJarAttribute(File, Attributes.Name)} (to remove in IDEA 15) */ - @SuppressWarnings("UnusedDeclaration") - public static String getJarAttributeVersion(@NotNull File jar, @NotNull Attributes.Name attribute, @Nullable String entryName) { - return entryName != null ? JarUtil.getJarAttribute(jar, entryName, attribute) : JarUtil.getJarAttribute(jar, attribute); - } } diff --git a/platform/core-api/src/com/intellij/openapi/application/ApplicationInfo.java b/platform/core-api/src/com/intellij/openapi/application/ApplicationInfo.java index e7a02e5aa710..1bc67e24bceb 100644 --- a/platform/core-api/src/com/intellij/openapi/application/ApplicationInfo.java +++ b/platform/core-api/src/com/intellij/openapi/application/ApplicationInfo.java @@ -54,10 +54,4 @@ public abstract class ApplicationInfo { public static boolean contextHelpAvailable() { return ApplicationManager.getApplication() != null && getInstance() != null && getInstance().hasContextHelp(); } - - /** @deprecated use {@link #getBuild()} instead (to remove in IDEA 14) */ - @SuppressWarnings("UnusedDeclaration") - public String getBuildNumber() { - return getBuild().asString(); - } } diff --git a/platform/core-api/src/com/intellij/openapi/vfs/StandardFileSystems.java b/platform/core-api/src/com/intellij/openapi/vfs/StandardFileSystems.java index 25818811e739..ce11b26399c2 100644 --- a/platform/core-api/src/com/intellij/openapi/vfs/StandardFileSystems.java +++ b/platform/core-api/src/com/intellij/openapi/vfs/StandardFileSystems.java @@ -68,12 +68,4 @@ public class StandardFileSystems { String localPath = path.substring(0, separatorIndex); return local().findFileByPath(localPath); } - - @SuppressWarnings("UnusedDeclaration") - /** @deprecated use {@link URLUtil#JAR_SEPARATOR} (to be removed in IDEA 15) */ - public static final String JAR_SEPARATOR = URLUtil.JAR_SEPARATOR; - - @SuppressWarnings("UnusedDeclaration") - /** @deprecated use {@link URLUtil#HTTP_PROTOCOL} (to be removed in IDEA 15) */ - public static final String HTTP_PROTOCOL = URLUtil.HTTP_PROTOCOL; } diff --git a/platform/core-api/src/com/intellij/openapi/vfs/VirtualFile.java b/platform/core-api/src/com/intellij/openapi/vfs/VirtualFile.java index 1929cdd7f383..9d3dc7f11c55 100644 --- a/platform/core-api/src/com/intellij/openapi/vfs/VirtualFile.java +++ b/platform/core-api/src/com/intellij/openapi/vfs/VirtualFile.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -235,18 +235,6 @@ public abstract class VirtualFile extends UserDataHolderBase implements Modifica */ public abstract boolean isDirectory(); - /** @deprecated use {@link #is(VFileProperty)} (to remove in IDEA 14) */ - @SuppressWarnings("UnusedDeclaration") - public boolean isSymLink() { - return is(VFileProperty.SYMLINK); - } - - /** @deprecated use {@link #is(VFileProperty)} (to remove in IDEA 14) */ - @SuppressWarnings("UnusedDeclaration") - public boolean isSpecialFile() { - return is(VFileProperty.SPECIAL); - } - /** * Checks whether this file has a specific property. * diff --git a/platform/core-api/src/com/intellij/openapi/vfs/VirtualFileSystem.java b/platform/core-api/src/com/intellij/openapi/vfs/VirtualFileSystem.java index 24828ab2b453..1cd16c1f7fc0 100644 --- a/platform/core-api/src/com/intellij/openapi/vfs/VirtualFileSystem.java +++ b/platform/core-api/src/com/intellij/openapi/vfs/VirtualFileSystem.java @@ -114,12 +114,6 @@ public abstract class VirtualFileSystem { */ public abstract void removeVirtualFileListener(@NotNull VirtualFileListener listener); - /** @deprecated. Current implementation blindly calls plain refresh against the file passed (to be removed in IDEA 15) */ - @SuppressWarnings("unused") - public void forceRefreshFile(boolean asynchronous, @NotNull VirtualFile file) { - file.refresh(asynchronous, false); - } - /** * Implementation of deleting files in this file system * diff --git a/platform/editor-ui-api/src/com/intellij/openapi/ide/CopyPasteManager.java b/platform/editor-ui-api/src/com/intellij/openapi/ide/CopyPasteManager.java index 756631c6b3ff..f551a9360b1e 100644 --- a/platform/editor-ui-api/src/com/intellij/openapi/ide/CopyPasteManager.java +++ b/platform/editor-ui-api/src/com/intellij/openapi/ide/CopyPasteManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,12 +39,6 @@ public abstract class CopyPasteManager { public abstract void removeContentChangedListener(@NotNull ContentChangedListener listener); - /** @deprecated use {@link #getContents(DataFlavor)} or {@link #areDataFlavorsAvailable(DataFlavor...)} (to remove in IDEA 14) */ - @SuppressWarnings("unused") - public boolean isDataFlavorAvailable(@Nullable DataFlavor flavor) { - return flavor != null && areDataFlavorsAvailable(flavor); - } - public abstract boolean areDataFlavorsAvailable(@NotNull DataFlavor... flavors); @Nullable diff --git a/platform/lang-api/src/com/intellij/formatting/Wrap.java b/platform/lang-api/src/com/intellij/formatting/Wrap.java index 1dc14ac3fe5e..ae4f42fef69a 100644 --- a/platform/lang-api/src/com/intellij/formatting/Wrap.java +++ b/platform/lang-api/src/com/intellij/formatting/Wrap.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ package com.intellij.formatting; * is inserted before the block when formatting, if the block extends beyond the * right margin. * - * @see com.intellij.formatting.Block#getWrap() + * @see Block#getWrap() */ public abstract class Wrap { /** @@ -31,22 +31,6 @@ public abstract class Wrap { private static WrapFactory myFactory; - /** @deprecated use {@link WrapType#ALWAYS} (to remove in IDEA 14) */ - @SuppressWarnings({"UnusedDeclaration"}) - public static WrapType ALWAYS = WrapType.ALWAYS; - - /** @deprecated use {@link WrapType#NORMAL} (to remove in IDEA 14) */ - @SuppressWarnings({"UnusedDeclaration"}) - public static WrapType NORMAL = WrapType.NORMAL; - - /** @deprecated use {@link WrapType#NONE} (to remove in IDEA 14) */ - @SuppressWarnings({"UnusedDeclaration"}) - public static WrapType NONE = WrapType.NONE; - - /** @deprecated use {@link WrapType#CHOP_DOWN_IF_LONG} (to remove in IDEA 14) */ - @SuppressWarnings({"UnusedDeclaration"}) - public static WrapType CHOP_DOWN_IF_LONG = WrapType.CHOP_DOWN_IF_LONG; - static void setFactory(WrapFactory factory) { myFactory = factory; } diff --git a/platform/lang-api/src/com/intellij/openapi/project/ModuleNameTracker.java b/platform/lang-api/src/com/intellij/openapi/project/ModuleNameTracker.java deleted file mode 100644 index 66227ab4b8e2..000000000000 --- a/platform/lang-api/src/com/intellij/openapi/project/ModuleNameTracker.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright 2000-2015 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.intellij.openapi.project; - -import com.intellij.openapi.Disposable; -import com.intellij.openapi.module.Module; -import com.intellij.openapi.util.Disposer; -import org.jetbrains.annotations.NotNull; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** @deprecated use {@link ModuleListener#modulesRenamed(Project, java.util.List, com.intellij.util.Function)} (to remove in IDEA 14) */ -@SuppressWarnings("UnusedDeclaration") -public abstract class ModuleNameTracker extends ModuleAdapter { - private final Map myModulesNames = new HashMap(); - private final Project myProject; - - public ModuleNameTracker(Project project) { - myProject = project; - Disposer.register(project, new Disposable() { - @Override - public void dispose() { - myModulesNames.clear(); - } - }); - } - - @Override - public void moduleAdded(@NotNull final Project project, @NotNull final Module module) { - if (myProject == project) { - myModulesNames.put(module, module.getName()); - } - } - - @Override - public void moduleRemoved(@NotNull final Project project, @NotNull final Module module) { - if (myProject == project) { - myModulesNames.remove(module); - } - } - - @Override - public void modulesRenamed(final Project project, final List modules) { - if (myProject != project) { - return; - } - - Map old2newNames = new HashMap(modules.size()); - for (Module module : modules) { - String newName = module.getName(); - String oldName = myModulesNames.put(module, newName); - old2newNames.put(oldName, newName); - } - modulesRenamed(project, old2newNames); - } - - protected abstract void modulesRenamed(final Project project, final Map old2newNames); -} diff --git a/platform/platform-api/src/com/intellij/execution/configurations/GeneralCommandLine.java b/platform/platform-api/src/com/intellij/execution/configurations/GeneralCommandLine.java index f4dbdf25672c..c08353cc6524 100644 --- a/platform/platform-api/src/com/intellij/execution/configurations/GeneralCommandLine.java +++ b/platform/platform-api/src/com/intellij/execution/configurations/GeneralCommandLine.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,7 +31,6 @@ import com.intellij.util.PlatformUtils; import com.intellij.util.containers.ContainerUtil; import com.intellij.util.text.CaseInsensitiveStringHashingStrategy; import gnu.trove.THashMap; -import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -80,8 +79,14 @@ public class GeneralCommandLine implements UserDataHolder { return myExePath; } - public void setExePath(@NotNull @NonNls final String exePath) { + @NotNull + public GeneralCommandLine withExePath(@NotNull String exePath) { myExePath = exePath.trim(); + return this; + } + + public void setExePath(@NotNull String exePath) { + withExePath(exePath); } public File getWorkDirectory() { @@ -89,28 +94,22 @@ public class GeneralCommandLine implements UserDataHolder { } @NotNull - public GeneralCommandLine withWorkDirectory(@Nullable final String path) { + public GeneralCommandLine withWorkDirectory(@Nullable String path) { return withWorkDirectory(path != null ? new File(path) : null); } @NotNull - public GeneralCommandLine withWorkDirectory(@Nullable final File workDirectory) { + public GeneralCommandLine withWorkDirectory(@Nullable File workDirectory) { myWorkDirectory = workDirectory; return this; } - /** - * @deprecated Use {@link #withWorkDirectory(String)} instead. - */ - public void setWorkDirectory(@Nullable @NonNls final String path) { + public void setWorkDirectory(@Nullable String path) { withWorkDirectory(path); } - /** - * @deprecated Use {@link #withWorkDirectory(java.io.File)} instead. - */ - public void setWorkDirectory(@Nullable final File workDirectory) { - myWorkDirectory = workDirectory; + public void setWorkDirectory(@Nullable File workDirectory) { + withWorkDirectory(workDirectory); } /** @@ -129,39 +128,18 @@ public class GeneralCommandLine implements UserDataHolder { return this; } - /** - * @deprecated use {@link #getEnvironment()} (to remove in IDEA 14) - */ - @SuppressWarnings("unused") - public Map getEnvParams() { - return getEnvironment(); + public boolean isPassParentEnvironment() { + return myPassParentEnvironment; } - /** - * @deprecated use {@link #getEnvironment()} (to remove in IDEA 14) - */ - @SuppressWarnings("unused") - public void setEnvParams(@Nullable Map envParams) { - myEnvParams.clear(); - if (envParams != null) { - myEnvParams.putAll(envParams); - } + @NotNull + public GeneralCommandLine withPassParentEnvironment(boolean passParentEnvironment) { + myPassParentEnvironment = passParentEnvironment; + return this; } public void setPassParentEnvironment(boolean passParentEnvironment) { - myPassParentEnvironment = passParentEnvironment; - } - - /** - * @deprecated use {@link #setPassParentEnvironment(boolean)} (to remove in IDEA 14) - */ - @SuppressWarnings({"unused", "SpellCheckingInspection"}) - public void setPassParentEnvs(boolean passParentEnvironment) { - setPassParentEnvironment(passParentEnvironment); - } - - public boolean isPassParentEnvironment() { - return myPassParentEnvironment; + withPassParentEnvironment(passParentEnvironment); } /** @@ -173,19 +151,19 @@ public class GeneralCommandLine implements UserDataHolder { : EnvironmentUtil.getEnvironmentMap()); } - public void addParameters(final String... parameters) { + public void addParameters(String... parameters) { for (String parameter : parameters) { addParameter(parameter); } } - public void addParameters(@NotNull final List parameters) { - for (final String parameter : parameters) { + public void addParameters(@NotNull List parameters) { + for (String parameter : parameters) { addParameter(parameter); } } - public void addParameter(@NotNull @NonNls final String parameter) { + public void addParameter(@NotNull String parameter) { myProgramParams.add(parameter); } @@ -198,24 +176,28 @@ public class GeneralCommandLine implements UserDataHolder { return myCharset; } - public GeneralCommandLine withCharset(@NotNull final Charset charset) { + @NotNull + public GeneralCommandLine withCharset(@NotNull Charset charset) { myCharset = charset; return this; } - /** - * @deprecated Use {@link #withCharset} instead. - */ - public void setCharset(@NotNull final Charset charset) { - myCharset = charset; + public void setCharset(@NotNull Charset charset) { + withCharset(charset); } public boolean isRedirectErrorStream() { return myRedirectErrorStream; } - public void setRedirectErrorStream(final boolean redirectErrorStream) { + @NotNull + public GeneralCommandLine withRedirectErrorStream(boolean redirectErrorStream) { myRedirectErrorStream = redirectErrorStream; + return this; + } + + public void setRedirectErrorStream(boolean redirectErrorStream) { + withRedirectErrorStream(redirectErrorStream); } /** @@ -235,12 +217,12 @@ public class GeneralCommandLine implements UserDataHolder { * @param exeName use this executable name instead of given by {@link #setExePath(String)} * @return single-string representation of this command line. */ - public String getCommandLineString(@Nullable final String exeName) { + public String getCommandLineString(@Nullable String exeName) { return ParametersList.join(getCommandLineList(exeName)); } - public List getCommandLineList(@Nullable final String exeName) { - final List commands = new ArrayList(); + public List getCommandLineList(@Nullable String exeName) { + List commands = new ArrayList(); if (exeName != null) { commands.add(exeName); } @@ -358,16 +340,16 @@ public class GeneralCommandLine implements UserDataHolder { } @Override - public T getUserData(@NotNull final Key key) { + public T getUserData(@NotNull Key key) { if (myUserData != null) { - @SuppressWarnings({"UnnecessaryLocalVariable", "unchecked"}) final T t = (T)myUserData.get(key); + @SuppressWarnings({"UnnecessaryLocalVariable", "unchecked"}) T t = (T)myUserData.get(key); return t; } return null; } @Override - public void putUserData(@NotNull final Key key, @Nullable final T value) { + public void putUserData(@NotNull Key key, @Nullable T value) { if (myUserData == null) { myUserData = ContainerUtil.newHashMap(); } diff --git a/platform/platform-api/src/com/intellij/execution/process/ColoredProcessHandler.java b/platform/platform-api/src/com/intellij/execution/process/ColoredProcessHandler.java index f296b9df9ba7..22988f7c3e6c 100644 --- a/platform/platform-api/src/com/intellij/execution/process/ColoredProcessHandler.java +++ b/platform/platform-api/src/com/intellij/execution/process/ColoredProcessHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -60,12 +60,9 @@ public class ColoredProcessHandler extends OSProcessHandler implements AnsiEscap * Overrides should call super.coloredTextAvailable() if they want to pass lines to registered listeners * To receive chunks of data instead of fragments inherit your class from ColoredChunksAcceptor interface and * override coloredChunksAvailable method. - * @param text - * @param attributes */ @Override public void coloredTextAvailable(String text, Key attributes) { - textAvailable(text, attributes); notifyColoredListeners(text, attributes); } @@ -82,14 +79,4 @@ public class ColoredProcessHandler extends OSProcessHandler implements AnsiEscap public void removeColoredTextListener(AnsiEscapeDecoder.ColoredTextAcceptor listener) { myColoredTextListeners.remove(listener); } - - /** - * @deprecated Inheritors should override coloredTextAvailable method - * or implement {@link com.intellij.execution.process.AnsiEscapeDecoder.ColoredChunksAcceptor} - * and override method coloredChunksAvailable to process colored chunks. - * To be removed in IDEA 14. - */ - protected void textAvailable(final String text, final Key attributes) { - super.notifyTextAvailable(text, attributes); - } } diff --git a/platform/platform-api/src/com/intellij/execution/util/ExecUtil.java b/platform/platform-api/src/com/intellij/execution/util/ExecUtil.java index eadb4769da6d..2b3902337fb7 100644 --- a/platform/platform-api/src/com/intellij/execution/util/ExecUtil.java +++ b/platform/platform-api/src/com/intellij/execution/util/ExecUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -84,22 +84,6 @@ public class ExecUtil { private ExecUtil() { } - /** - * @deprecated Use "new GeneralCommandLine(command).createProcess().waitFor()". - */ - @SuppressWarnings({"deprecation", "Contract"}) - public static int execAndGetResult(final String... command) throws ExecutionException, InterruptedException { - assert command != null && command.length > 0; - return execAndGetResult(Arrays.asList(command)); - } - - /** - * @deprecated Use "new GeneralCommandLine(command).createProcess().waitFor()". - */ - public static int execAndGetResult(@NotNull final List command) throws ExecutionException, InterruptedException { - return new GeneralCommandLine(command).createProcess().waitFor(); - } - @NotNull public static String loadTemplate(@NotNull ClassLoader loader, @NotNull String templateName, @Nullable Map variables) throws IOException { @SuppressWarnings("IOResourceOpenedButNotSafelyClosed") InputStream stream = loader.getResourceAsStream(templateName); @@ -150,60 +134,25 @@ public class ExecUtil { } @NotNull - public static ProcessOutput execAndGetOutput(@NotNull final GeneralCommandLine commandLine) throws ExecutionException { - final Process process = commandLine.createProcess(); - final CapturingProcessHandler processHandler = new CapturingProcessHandler(process); - return processHandler.runProcess(); - } - - /** - * @deprecated Use {@link #execAndGetOutput(com.intellij.execution.configurations.GeneralCommandLine)} instead. - */ - @NotNull - public static ProcessOutput execAndGetOutput(@NotNull final List command, - @Nullable final String workDir) throws ExecutionException { - final Process process = new GeneralCommandLine(command).withWorkDirectory(workDir).createProcess(); - final CapturingProcessHandler processHandler = new CapturingProcessHandler(process); - return processHandler.runProcess(); + public static ProcessOutput execAndGetOutput(@NotNull GeneralCommandLine commandLine) throws ExecutionException { + return new CapturingProcessHandler(commandLine.createProcess()).runProcess(); } @Nullable - public static String execAndReadLine(@NotNull final GeneralCommandLine commandLine) { + public static String execAndReadLine(@NotNull GeneralCommandLine commandLine) { try { return readFirstLine(commandLine.createProcess().getInputStream(), commandLine.getCharset()); } - catch (Exception ignored) { - return null; - } - } - - /** - * @deprecated Use {@link #execAndReadLine(com.intellij.execution.configurations.GeneralCommandLine)} instead. - */ - @SuppressWarnings("deprecation") - @Nullable - public static String execAndReadLine(final String... command) { - return execAndReadLine(null, command); - } - - /** - * @deprecated Use {@link #execAndReadLine(com.intellij.execution.configurations.GeneralCommandLine)} instead. - */ - @Nullable - public static String execAndReadLine(@Nullable Charset charset, final String... command) { - try { - return readFirstLine(new GeneralCommandLine(command).createProcess().getInputStream(), charset); - } - catch (Exception ignored) { + catch (ExecutionException ignored) { return null; } } @Nullable - public static String readFirstLine(@NotNull InputStream inputStream, @Nullable Charset charset) { - @SuppressWarnings("IOResourceOpenedButNotSafelyClosed") - BufferedReader reader = new BufferedReader(charset == null ? new InputStreamReader(inputStream) : new InputStreamReader(inputStream, charset)); + public static String readFirstLine(@NotNull InputStream stream, @Nullable Charset cs) { try { + @SuppressWarnings("IOResourceOpenedButNotSafelyClosed") + BufferedReader reader = new BufferedReader(cs == null ? new InputStreamReader(stream) : new InputStreamReader(stream, cs)); try { return reader.readLine(); } @@ -226,8 +175,7 @@ public class ExecUtil { * @return the results of running the process */ @NotNull - public static Process sudo(@NotNull final GeneralCommandLine commandLine, - @NotNull final String prompt) throws ExecutionException,IOException { + public static Process sudo(@NotNull GeneralCommandLine commandLine, @NotNull String prompt) throws ExecutionException, IOException { final File workDir = commandLine.getWorkDirectory(); final List command = new ArrayList(); command.add(commandLine.getExePath()); @@ -295,25 +243,12 @@ public class ExecUtil { } @NotNull - public static ProcessOutput sudoAndGetOutput(@NotNull final GeneralCommandLine commandLine, - @NotNull final String prompt) throws IOException, ExecutionException { + public static ProcessOutput sudoAndGetOutput(@NotNull GeneralCommandLine commandLine, @NotNull String prompt) throws IOException, ExecutionException { final Process process = sudo(commandLine, prompt); final CapturingProcessHandler processHandler = new CapturingProcessHandler(process); return processHandler.runProcess(); } - /** - * @deprecated Use {@link #sudoAndGetOutput(com.intellij.execution.configurations.GeneralCommandLine, String)} instead. - */ - @SuppressWarnings("UnusedDeclaration") - @NotNull - public static ProcessOutput sudoAndGetOutput(@NotNull List command, @NotNull String prompt, - @Nullable String workDir) throws IOException, ExecutionException { - final Process process = sudo(new GeneralCommandLine(command).withWorkDirectory(workDir), prompt); - final CapturingProcessHandler processHandler = new CapturingProcessHandler(process); - return processHandler.runProcess(); - } - @NotNull private static String escapeAppleScriptArgument(@NotNull String arg) { return "quoted form of \"" + arg.replace("\"", "\\\"") + "\""; @@ -324,56 +259,6 @@ public class ExecUtil { return "'" + arg.replace("'", "'\"'\"'") + "'"; } - /** @deprecated relies on platform-dependent escaping, use {@link #sudoAndGetOutput(List, String, String)} instead (to remove in IDEA 14) */ - @SuppressWarnings({"UnusedDeclaration", "deprecation"}) - public static ProcessOutput sudoAndGetOutput(@NotNull String scriptPath, @NotNull String prompt) throws IOException, ExecutionException { - return sudoAndGetOutput(scriptPath, prompt, null); - } - - /** @deprecated relies on platform-dependent escaping, use {@link #sudoAndGetOutput(List, String, String)} instead (to remove in IDEA 14) */ - @SuppressWarnings("deprecation") - @NotNull - public static ProcessOutput sudoAndGetOutput(@NotNull String scriptPath, - @NotNull String prompt, - @Nullable String workDir) throws IOException, ExecutionException { - if (SystemInfo.isMac) { - final String script = "do shell script \"" + scriptPath + "\" with administrator privileges"; - return execAndGetOutput(Arrays.asList(getOsascriptPath(), "-e", script), workDir); - } - else if ("root".equals(System.getenv("USER"))) { - return execAndGetOutput(Collections.singletonList(scriptPath), workDir); - } - else if (hasKdeSudo.getValue()) { - return execAndGetOutput(Arrays.asList("kdesudo", "--comment", prompt, scriptPath), workDir); - } - else if (hasGkSudo.getValue()) { - return execAndGetOutput(Arrays.asList("gksudo", "--message", prompt, scriptPath), workDir); - } - else if (hasPkExec.getValue()) { - return execAndGetOutput(Arrays.asList("pkexec", scriptPath), workDir); - } - else if (SystemInfo.isUnix && hasTerminalApp()) { - final File sudo = createTempExecutableScript("sudo", ".sh", - "#!/bin/sh\n" + - "echo \"" + prompt + "\"\n" + - "echo\n" + - "sudo " + scriptPath + "\n" + - "STATUS=$?\n" + - "echo\n" + - "read -p \"Press Enter to close this window...\" TEMP\n" + - "exit $STATUS\n"); - return execAndGetOutput(getTerminalCommand("Install", sudo.getAbsolutePath()), workDir); - } - - throw new UnsupportedSystemException(); - } - - /** @deprecated relies on platform-dependent escaping, use {@link #sudoAndGetOutput(List, String, String)} instead (to remove in IDEA 14) */ - @SuppressWarnings({"UnusedDeclaration", "deprecation"}) - public static int sudoAndGetResult(@NotNull String scriptPath, @NotNull String prompt) throws IOException, ExecutionException { - return sudoAndGetOutput(scriptPath, prompt, null).getExitCode(); - } - public static boolean hasTerminalApp() { return SystemInfo.isWindows || SystemInfo.isMac || hasKdeTerminal.getValue() || hasGnomeTerminal.getValue() || hasXTerm.getValue(); } @@ -385,10 +270,10 @@ public class ExecUtil { return Arrays.asList(getWindowsShellName(), "/c", "start", GeneralCommandLine.inescapableQuote(title), command); } else if (SystemInfo.isMac) { - return Arrays.asList(getOpenCommandPath(), "-a", "Terminal", command); // todo[r.sh] title? + return Arrays.asList(getOpenCommandPath(), "-a", "Terminal", command); } else if (hasKdeTerminal.getValue()) { - return Arrays.asList("/usr/bin/konsole", "-e", command); // todo[r.sh] title? + return Arrays.asList("/usr/bin/konsole", "-e", command); } else if (hasGnomeTerminal.getValue()) { return title != null ? Arrays.asList("/usr/bin/gnome-terminal", "-t", title, "-x", command) @@ -407,4 +292,40 @@ public class ExecUtil { super("Unsupported OS/desktop: " + SystemInfo.OS_NAME + '/' + SystemInfo.SUN_DESKTOP); } } + + // deprecated stuff + + /** @deprecated use {@code new GeneralCommandLine(command).createProcess().waitFor()} (to be removed in IDEA 16) */ + @SuppressWarnings("unused") + public static int execAndGetResult(String... command) throws ExecutionException, InterruptedException { + assert command != null && command.length > 0; + return new GeneralCommandLine(command).createProcess().waitFor(); + } + + /** @deprecated use {@code new GeneralCommandLine(command).createProcess().waitFor()} (to be removed in IDEA 16) */ + @SuppressWarnings("unused") + public static int execAndGetResult(@NotNull List command) throws ExecutionException, InterruptedException { + return new GeneralCommandLine(command).createProcess().waitFor(); + } + + /** @deprecated use {@link #execAndGetOutput(GeneralCommandLine)} instead (to be removed in IDEA 16) */ + @SuppressWarnings("unused") + public static ProcessOutput execAndGetOutput(@NotNull List command, @Nullable String workDir) throws ExecutionException { + Process process = new GeneralCommandLine(command).withWorkDirectory(workDir).createProcess(); + return new CapturingProcessHandler(process).runProcess(); + } + + /** @deprecated use {@link #execAndReadLine(GeneralCommandLine)} instead (to be removed in IDEA 16) */ + @SuppressWarnings("unused") + public static String execAndReadLine(String... command) { + return execAndReadLine(new GeneralCommandLine(command)); + } + + /** @deprecated use {@link #execAndReadLine(GeneralCommandLine)} instead (to be removed in IDEA 16) */ + @SuppressWarnings("unused") + public static String execAndReadLine(@Nullable Charset charset, String... command) { + GeneralCommandLine commandLine = new GeneralCommandLine(command); + if (charset != null) commandLine = commandLine.withCharset(charset); + return execAndReadLine(commandLine); + } } diff --git a/platform/platform-api/src/com/intellij/ide/util/treeView/AbstractTreeBuilder.java b/platform/platform-api/src/com/intellij/ide/util/treeView/AbstractTreeBuilder.java index ac29267a2848..f57a44485e69 100644 --- a/platform/platform-api/src/com/intellij/ide/util/treeView/AbstractTreeBuilder.java +++ b/platform/platform-api/src/com/intellij/ide/util/treeView/AbstractTreeBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -484,17 +484,6 @@ public class AbstractTreeBuilder implements Disposable { } } - @SuppressWarnings({"UnusedDeclaration", "SpellCheckingInspection"}) - @Deprecated - @NotNull - /** - * @deprecated use {@link #getInitialized()} - * to remove in IDEA 14 - */ - public final ActionCallback getIntialized() { - return getInitialized(); - } - @NotNull public final ActionCallback getInitialized() { if (isDisposed()) { diff --git a/platform/platform-api/src/com/intellij/lang/LanguageDialect.java b/platform/platform-api/src/com/intellij/lang/LanguageDialect.java deleted file mode 100644 index f5bc6b2bceea..000000000000 --- a/platform/platform-api/src/com/intellij/lang/LanguageDialect.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2000-2014 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.intellij.lang; - -import org.jetbrains.annotations.NonNls; -import org.jetbrains.annotations.NotNull; - -/** @deprecated use {@linkplain Language#Language(Language, String, String...)} (to remove in IDEA 15) */ -@SuppressWarnings("UnusedDeclaration") -public abstract class LanguageDialect extends Language { - public LanguageDialect(@NonNls @NotNull String id, @NotNull Language baseLanguage) { - super(baseLanguage, id, ""); - } -} \ No newline at end of file diff --git a/platform/platform-api/src/com/intellij/openapi/diff/BinaryContent.java b/platform/platform-api/src/com/intellij/openapi/diff/BinaryContent.java index d4f9a388e33c..77ccc233f53f 100644 --- a/platform/platform-api/src/com/intellij/openapi/diff/BinaryContent.java +++ b/platform/platform-api/src/com/intellij/openapi/diff/BinaryContent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ import com.intellij.openapi.fileEditor.OpenFileDescriptor; import com.intellij.openapi.fileTypes.FileType; import com.intellij.openapi.fileTypes.UIBasedFileType; import com.intellij.openapi.project.Project; -import com.intellij.openapi.project.ProjectManager; +import com.intellij.openapi.util.io.FileUtil; import com.intellij.openapi.vfs.CharsetToolkit; import com.intellij.openapi.vfs.LocalFileSystem; import com.intellij.openapi.vfs.VirtualFile; @@ -31,7 +31,6 @@ import com.intellij.util.ObjectUtils; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.io.File; import java.io.IOException; import java.nio.charset.Charset; import java.nio.charset.IllegalCharsetNameException; @@ -40,48 +39,26 @@ import java.nio.charset.IllegalCharsetNameException; * A {@link DiffContent} represented as a byte array. It still contain a text though. */ public class BinaryContent extends DiffContent { - @NotNull private final Project myProject; - @NotNull - private final FileType myFileType; + private final Project myProject; private final byte[] myBytes; private final Charset myCharset; - private Document myDocument = null; + private final FileType myFileType; private final String myFilePath; + private Document myDocument = null; /** * @param charset use to convert bytes to String. null means bytes can't be converted to text. Has no sense if fileType.isBinary() * @param fileType type of content */ - public BinaryContent(@NotNull Project project, byte[] bytes, @Nullable Charset charset, @NotNull FileType fileType, - @Nullable String filePath) { + public BinaryContent(@NotNull Project project, byte[] bytes, @Nullable Charset charset, @NotNull FileType fileType, @Nullable String filePath) { myProject = project; - myFileType = fileType; myBytes = bytes; - if (fileType.isBinary()) { - myCharset = null; - } - else { - myCharset = charset; - } + myCharset = fileType.isBinary() ? null : charset; + myFileType = fileType; myFilePath = filePath; } - /** - * @deprecated to remove in IDEA 14. Use {@link #BinaryContent(Project, byte[], Charset, FileType, String)}. - */ - public BinaryContent(byte[] bytes, Charset charset, @NotNull FileType fileType) { - this(bytes, charset, fileType, null); - } - - /** - * @deprecated to remove in IDEA 14. Use {@link #BinaryContent(Project, byte[], Charset, FileType, String)}. - */ - public BinaryContent(byte[] bytes, Charset charset, @NotNull FileType fileType, String filePath) { - this(ProjectManager.getInstance().getDefaultProject(), bytes, charset, fileType, filePath); - } - @Override - @SuppressWarnings({"EmptyCatchBlock"}) @Nullable public Document getDocument() { if (myDocument == null) { @@ -92,8 +69,7 @@ public class BinaryContent extends DiffContent { Charset charset = ObjectUtils.notNull(myCharset, EncodingProjectManager.getInstance(myProject).getDefaultCharset()); text = CharsetToolkit.bytesToString(myBytes, charset); } - catch (IllegalCharsetNameException e) { - } + catch (IllegalCharsetNameException ignored) { } // Still NULL? only if not supported or an exception was thrown. // Decode a string using the truly default encoding. @@ -103,6 +79,7 @@ public class BinaryContent extends DiffContent { myDocument = EditorFactory.getInstance().createDocument(text); myDocument.setReadOnly(true); } + return myDocument; } @@ -114,7 +91,7 @@ public class BinaryContent extends DiffContent { @Nullable private VirtualFile findVirtualFile() { - return LocalFileSystem.getInstance().findFileByIoFile(new File(myFilePath)); + return myFilePath != null ? LocalFileSystem.getInstance().findFileByPath(FileUtil.toSystemIndependentName(myFilePath)) : null; } @Override diff --git a/platform/platform-api/src/com/intellij/openapi/editor/RawText.java b/platform/platform-api/src/com/intellij/openapi/editor/RawText.java index 5d69d1fa2efe..59b520c9720e 100644 --- a/platform/platform-api/src/com/intellij/openapi/editor/RawText.java +++ b/platform/platform-api/src/com/intellij/openapi/editor/RawText.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ */ package com.intellij.openapi.editor; -import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.Nullable; import java.awt.datatransfer.DataFlavor; @@ -29,8 +28,7 @@ import java.io.Serializable; * @since Sep 5, 2006 */ public class RawText implements Cloneable, Serializable { - /** @deprecated use {@link #getDataFlavor()} (to make private in IDEA 14) */ - public static @NonNls DataFlavor ourFlavor; + private static DataFlavor ourFlavor; public String rawText; @@ -47,7 +45,6 @@ public class RawText implements Cloneable, Serializable { } } - @SuppressWarnings("deprecation") public static DataFlavor getDataFlavor() { if (ourFlavor != null) return ourFlavor; diff --git a/platform/platform-api/src/com/intellij/openapi/fileChooser/FileChooserDescriptor.java b/platform/platform-api/src/com/intellij/openapi/fileChooser/FileChooserDescriptor.java index 4c6657015fa6..6de79ccf505f 100644 --- a/platform/platform-api/src/com/intellij/openapi/fileChooser/FileChooserDescriptor.java +++ b/platform/platform-api/src/com/intellij/openapi/fileChooser/FileChooserDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -116,12 +116,6 @@ public class FileChooserDescriptor implements Cloneable { return myChooseMultiple; } - /** @deprecated use {@link #isChooseMultiple()} (to be removed in IDEA 15) */ - @SuppressWarnings("UnusedDeclaration") - public boolean getChooseMultiple() { - return isChooseMultiple(); - } - public String getTitle() { return myTitle; } @@ -205,12 +199,6 @@ public class FileChooserDescriptor implements Cloneable { return this; } - /** @deprecated use {@link #withTreeRootVisible(boolean)} (to be removed in IDEA 15) */ - @SuppressWarnings("UnusedDeclaration") - public FileChooserDescriptor setIsTreeRootVisible(boolean treeRootVisible) { - return withTreeRootVisible(treeRootVisible); - } - public boolean isShowHiddenFiles() { return myShowHiddenFiles; } diff --git a/platform/platform-api/src/com/intellij/openapi/fileChooser/FileChooserDescriptorBuilder.java b/platform/platform-api/src/com/intellij/openapi/fileChooser/FileChooserDescriptorBuilder.java deleted file mode 100644 index 8f45744d70e1..000000000000 --- a/platform/platform-api/src/com/intellij/openapi/fileChooser/FileChooserDescriptorBuilder.java +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright 2000-2014 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.intellij.openapi.fileChooser; - -import com.intellij.openapi.vfs.VirtualFile; -import org.jetbrains.annotations.NotNull; - -import java.util.List; - -/** @deprecated use {@link FileChooserDescriptor} or {@link FileChooserDescriptorFactory} (to be removed in IDEA 15) */ -@SuppressWarnings({"UnusedDeclaration", "deprecation"}) -public class FileChooserDescriptorBuilder { - private boolean myChooseFiles; - private boolean myChooseFolders; - private boolean myChooseJars; - private boolean myChooseJarsAsFiles; - private boolean myChooseJarContents; - private boolean myChooseMultiple; - - private String myTitle = null; - private String myDescription = null; - private Boolean myShowFileSystemRoots = null; - private Boolean myHideIgnored = null; - private Boolean myTreeRootVisible = null; - private List myRoots = null; - - public FileChooserDescriptorBuilder(boolean chooseFiles, - boolean chooseFolders, - boolean chooseJars, - boolean chooseJarsAsFiles, - boolean chooseJarContents, - boolean chooseMultiple) { - myChooseFiles = chooseFiles; - myChooseFolders = chooseFolders; - myChooseJars = chooseJars; - myChooseJarsAsFiles = chooseJarsAsFiles; - myChooseJarContents = chooseJarContents; - myChooseMultiple = chooseMultiple; - } - - public static FileChooserDescriptorBuilder onlyFiles() { - return new FileChooserDescriptorBuilder(true, false, false, false, false, false); - } - - public static FileChooserDescriptorBuilder onlyFolders() { - return new FileChooserDescriptorBuilder(false, true, false, false, false, false); - } - - public static FileChooserDescriptorBuilder filesAndFolders() { - return new FileChooserDescriptorBuilder(true, true, false, false, false, false); - } - - public FileChooserDescriptorBuilder chooseMultiple() { - myChooseMultiple = true; - return this; - } - - public FileChooserDescriptorBuilder chooseJars(boolean chooseJars, boolean chooseJarsAsFiles, boolean chooseJarContents) { - myChooseJars = chooseJars; - myChooseJarsAsFiles = chooseJarsAsFiles; - myChooseJarContents = chooseJarContents; - return this; - } - - public FileChooserDescriptorBuilder withTitle(@NotNull String title) { - myTitle = title; - return this; - } - - public FileChooserDescriptorBuilder withDescription(@NotNull String description) { - myDescription = description; - return this; - } - - public FileChooserDescriptorBuilder hideSystemRoots() { - myShowFileSystemRoots = false; - return this; - } - - public FileChooserDescriptorBuilder showIgnored() { - myHideIgnored = false; - return this; - } - - public FileChooserDescriptorBuilder withTreeRootVisible(boolean isTreeRootVisible) { - myTreeRootVisible = isTreeRootVisible; - return this; - } - - public FileChooserDescriptorBuilder withRoots(List roots) { - myRoots = roots; - return this; - } - - public FileChooserDescriptor build() { - FileChooserDescriptor descriptor = - new FileChooserDescriptor(myChooseFiles, myChooseFolders, myChooseJars, myChooseJarsAsFiles, myChooseJarContents, myChooseMultiple); - - if (myTitle != null) { - descriptor.setTitle(myTitle); - } - - if (myDescription != null) { - descriptor.setDescription(myDescription); - } - - if (myShowFileSystemRoots != null) { - descriptor.setShowFileSystemRoots(myShowFileSystemRoots); - } - - if (myHideIgnored != null) { - descriptor.setHideIgnored(myHideIgnored); - } - - if (myTreeRootVisible != null) { - descriptor.withTreeRootVisible(myTreeRootVisible); - } - - if (myRoots != null) { - descriptor.setRoots(myRoots); - } - - return descriptor; - } -} diff --git a/platform/platform-api/src/com/intellij/openapi/fileChooser/FileChooserDescriptorFactory.java b/platform/platform-api/src/com/intellij/openapi/fileChooser/FileChooserDescriptorFactory.java index 42ee6ab777bc..608b7a5bfd70 100644 --- a/platform/platform-api/src/com/intellij/openapi/fileChooser/FileChooserDescriptorFactory.java +++ b/platform/platform-api/src/com/intellij/openapi/fileChooser/FileChooserDescriptorFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -96,44 +96,4 @@ public class FileChooserDescriptorFactory { } }); } - - /** - * @deprecated use {@link #createSingleFileDescriptor(FileType)} or {@link #createSingleFileOrFolderDescriptor(FileType)} (to be removed in IDEA 14) - */ - @SuppressWarnings("UnusedDeclaration") - public static FileChooserDescriptor createSingleFileDescriptor(final FileType fileType, final boolean supportDirectories) { - return supportDirectories ? createSingleFileOrFolderDescriptor(fileType) : createSingleFileDescriptor(fileType); - } - - /** - * @deprecated not very useful (to be removed in IDEA 15) - */ - @SuppressWarnings("UnusedDeclaration") - public static FileChooserDescriptor getDirectoryChooserDescriptor(String objectName) { - return createSingleFolderDescriptor().withTitle("Select " + objectName); - } - - /** - * @deprecated not very useful (to be removed in IDEA 15) - */ - @SuppressWarnings("UnusedDeclaration") - public static FileChooserDescriptor getFileChooserDescriptor(String objectName) { - return createSingleFileNoJarsDescriptor().withTitle("Select " + objectName); - } - - /** - * @deprecated use {@link #createSingleFileNoJarsDescriptor()} (to be removed in IDEA 15) - */ - @SuppressWarnings({"UnusedDeclaration", "deprecation"}) - public static FileChooserDescriptorBuilder onlyFiles() { - return FileChooserDescriptorBuilder.onlyFiles(); - } - - /** - * @deprecated use {@link #createSingleFileOrFolderDescriptor()} ()} (to be removed in IDEA 15) - */ - @SuppressWarnings({"UnusedDeclaration", "deprecation"}) - public static FileChooserDescriptorBuilder filesAndFolders() { - return FileChooserDescriptorBuilder.filesAndFolders(); - } } diff --git a/platform/platform-api/src/com/intellij/openapi/ui/ComponentWithBrowseButton.java b/platform/platform-api/src/com/intellij/openapi/ui/ComponentWithBrowseButton.java index cf0386066bef..00f1ec823aab 100644 --- a/platform/platform-api/src/com/intellij/openapi/ui/ComponentWithBrowseButton.java +++ b/platform/platform-api/src/com/intellij/openapi/ui/ComponentWithBrowseButton.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -288,15 +288,8 @@ public class ComponentWithBrowseButton extends JPanel i return chosenFile.getPresentableUrl(); } - /** @deprecated use/override {@link #onFileChosen(VirtualFile)} (to be removed in IDEA 15) */ - @SuppressWarnings("SpellCheckingInspection") - protected void onFileChoosen(@NotNull VirtualFile chosenFile) { - myAccessor.setText(myTextComponent.getChildComponent(), chosenFileToResultingText(chosenFile)); - } - - @SuppressWarnings("deprecation") protected void onFileChosen(@NotNull VirtualFile chosenFile) { - onFileChoosen(chosenFile); + myAccessor.setText(myTextComponent.getChildComponent(), chosenFileToResultingText(chosenFile)); } } diff --git a/platform/platform-api/src/com/intellij/openapi/vfs/LocalFileSystem.java b/platform/platform-api/src/com/intellij/openapi/vfs/LocalFileSystem.java index b2034ed31216..f7f2b659bb7b 100644 --- a/platform/platform-api/src/com/intellij/openapi/vfs/LocalFileSystem.java +++ b/platform/platform-api/src/com/intellij/openapi/vfs/LocalFileSystem.java @@ -15,8 +15,6 @@ */ package com.intellij.openapi.vfs; -import com.intellij.openapi.util.SystemInfo; -import com.intellij.openapi.vfs.newvfs.ManagingFS; import com.intellij.openapi.vfs.newvfs.NewVirtualFileSystem; import com.intellij.util.Processor; import com.intellij.util.io.fs.IFile; @@ -84,13 +82,6 @@ public abstract class LocalFileSystem extends NewVirtualFileSystem { public abstract void refreshFiles(@NotNull Iterable files, boolean async, boolean recursive, @Nullable Runnable onFinish); - /** @deprecated fake root considered harmful (to remove in IDEA 14) */ - public final VirtualFile getRoot() { - VirtualFile[] roots = ManagingFS.getInstance().getLocalRoots(); - assert roots.length > 0 : SystemInfo.OS_NAME; - return roots[0]; - } - public interface WatchRequest { @NotNull String getRootPath(); diff --git a/platform/platform-api/src/com/intellij/openapi/vfs/VfsUtil.java b/platform/platform-api/src/com/intellij/openapi/vfs/VfsUtil.java index 97eaffc6712a..f3e631e77c7c 100644 --- a/platform/platform-api/src/com/intellij/openapi/vfs/VfsUtil.java +++ b/platform/platform-api/src/com/intellij/openapi/vfs/VfsUtil.java @@ -47,9 +47,6 @@ import java.util.*; public class VfsUtil extends VfsUtilCore { private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.vfs.VfsUtil"); - /** @deprecated incorrect name, use {@link #VFS_SEPARATOR_CHAR} (to be removed in IDEA 15) */ - public static final char VFS_PATH_SEPARATOR = VFS_SEPARATOR_CHAR; - public static void saveText(@NotNull VirtualFile file, @NotNull String text) throws IOException { Charset charset = file.getCharset(); file.setBinaryContent(text.getBytes(charset.name())); diff --git a/platform/platform-api/src/com/intellij/openapi/wm/PassThroughtIdeFocusManager.java b/platform/platform-api/src/com/intellij/openapi/wm/PassThroughtIdeFocusManager.java deleted file mode 100644 index 47fe4ad4b87d..000000000000 --- a/platform/platform-api/src/com/intellij/openapi/wm/PassThroughtIdeFocusManager.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2000-2013 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.intellij.openapi.wm; - -/** @deprecated use {@link PassThroughIdeFocusManager} (to remove in IDEA 14) */ -@SuppressWarnings({"SpellCheckingInspection", "UnusedDeclaration"}) -public class PassThroughtIdeFocusManager extends PassThroughIdeFocusManager { } diff --git a/platform/platform-api/src/com/intellij/util/net/HTTPProxySettingsDialog.java b/platform/platform-api/src/com/intellij/util/net/HTTPProxySettingsDialog.java deleted file mode 100644 index 5d7d807095f1..000000000000 --- a/platform/platform-api/src/com/intellij/util/net/HTTPProxySettingsDialog.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright 2000-2014 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.intellij.util.net; - -import com.intellij.CommonBundle; -import com.intellij.openapi.ui.DialogWrapper; -import org.jetbrains.annotations.NotNull; - -import javax.swing.*; -import java.awt.event.ActionEvent; - -@Deprecated -@SuppressWarnings("UnusedDeclaration") -/** - * @deprecated Use {@link com.intellij.util.net.HttpConfigurable#editConfigurable(javax.swing.JComponent)} - * to remove in IDEA 15 - */ -public class HTTPProxySettingsDialog extends DialogWrapper { - private final HttpProxySettingsUi panel; - private final Action okAction; - private final Action cancelAction; - - public HTTPProxySettingsDialog() { - super(false); - - setTitle(CommonBundle.message("title.http.proxy.settings")); - final HttpConfigurable settings = HttpConfigurable.getInstance(); - panel = new HttpProxySettingsUi(settings); - panel.reset(settings); - - okAction = new AbstractAction(CommonBundle.getOkButtonText()) { - @Override - public void actionPerformed(@NotNull ActionEvent e) { - panel.apply(settings); - close(OK_EXIT_CODE); - } - }; - okAction.putValue(DEFAULT_ACTION, Boolean.TRUE.toString()); - cancelAction = new AbstractAction(CommonBundle.getCancelButtonText()) { - @Override - public void actionPerformed(@NotNull ActionEvent e) { - close(CANCEL_EXIT_CODE); - } - }; - init(); - } - - @Override - protected JComponent createCenterPanel() { - return panel.getComponent(); - } - - @Override - @NotNull - protected Action[] createActions() { - return new Action[]{okAction, cancelAction}; - } -} diff --git a/platform/platform-api/src/com/intellij/util/net/HTTPProxySettingsPanel.java b/platform/platform-api/src/com/intellij/util/net/HTTPProxySettingsPanel.java deleted file mode 100644 index f53c88f372e5..000000000000 --- a/platform/platform-api/src/com/intellij/util/net/HTTPProxySettingsPanel.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2000-2014 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.intellij.util.net; - -import org.jetbrains.annotations.NotNull; - -@SuppressWarnings("UnusedDeclaration") -@Deprecated -/** - * @deprecated Use {@link HttpProxyConfigurable} - * to remove in IDEA 15 - */ -public class HTTPProxySettingsPanel extends HttpProxyConfigurable { - public static final String NAME = "Proxy"; - - public HTTPProxySettingsPanel(@NotNull HttpConfigurable settings) { - super(settings); - } -} \ No newline at end of file diff --git a/platform/projectModel-api/src/com/intellij/openapi/project/ModuleAdapter.java b/platform/projectModel-api/src/com/intellij/openapi/project/ModuleAdapter.java index 357f9a96b871..f293b3dc92f4 100644 --- a/platform/projectModel-api/src/com/intellij/openapi/project/ModuleAdapter.java +++ b/platform/projectModel-api/src/com/intellij/openapi/project/ModuleAdapter.java @@ -34,12 +34,6 @@ public abstract class ModuleAdapter implements ModuleListener { @Override public void moduleRemoved(@NotNull Project project, @NotNull Module module) { } - @SuppressWarnings("deprecation") @Override - public void modulesRenamed(@NotNull Project project, @NotNull List modules, @NotNull Function oldNameProvider) { - modulesRenamed(project, modules); - } - - /** @deprecated implement {@link #modulesRenamed(Project, List, Function)} (to remove in IDEA 14) */ - public void modulesRenamed(Project project, List modules) { } + public void modulesRenamed(@NotNull Project project, @NotNull List modules, @NotNull Function oldNameProvider) { } } diff --git a/platform/util-rt/src/com/intellij/util/containers/ContainerUtilRt.java b/platform/util-rt/src/com/intellij/util/containers/ContainerUtilRt.java index 3b9f0fb4e597..c0f837977069 100644 --- a/platform/util-rt/src/com/intellij/util/containers/ContainerUtilRt.java +++ b/platform/util-rt/src/com/intellij/util/containers/ContainerUtilRt.java @@ -168,12 +168,6 @@ public class ContainerUtilRt { return copy(ContainerUtilRt.newArrayList(), elements); } - /** @deprecated Use {@link #newArrayListWithCapacity(int)} (to remove in IDEA 15) */ - @Contract(pure=true) - public static ArrayList newArrayListWithExpectedSize(int size) { - return newArrayListWithCapacity(size); - } - @NotNull @Contract(pure=true) public static ArrayList newArrayListWithCapacity(int size) { diff --git a/platform/util-rt/src/com/intellij/util/text/DateFormatUtilRt.java b/platform/util-rt/src/com/intellij/util/text/DateFormatUtilRt.java deleted file mode 100644 index 43462ae58864..000000000000 --- a/platform/util-rt/src/com/intellij/util/text/DateFormatUtilRt.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2000-2013 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.intellij.util.text; - -import org.jetbrains.annotations.NotNull; - -import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.Locale; - -@SuppressWarnings("UnusedDeclaration") -/** @deprecated to remove in IDEA 14 */ -public class DateFormatUtilRt { - private static final SimpleDateFormat BUILD_DATE_FORMAT = new SimpleDateFormat("dd MMM yyyy HH:ss", Locale.US); - - @NotNull - public static String formatBuildDate(@NotNull Calendar cal) { - return BUILD_DATE_FORMAT.format(cal.getTime()); - } -} diff --git a/platform/util/src/com/intellij/openapi/application/PathManager.java b/platform/util/src/com/intellij/openapi/application/PathManager.java index ac5c658ecf46..d6f99ad727a9 100644 --- a/platform/util/src/com/intellij/openapi/application/PathManager.java +++ b/platform/util/src/com/intellij/openapi/application/PathManager.java @@ -520,40 +520,4 @@ public class PathManager { } return false; } - - // outdated stuff - - /** @deprecated use {@link #getPluginsPath()} (to remove in IDEA 14) */ - @SuppressWarnings("UnusedDeclaration") public static final String PLUGINS_DIRECTORY = PLUGINS_FOLDER; - - /** @deprecated use {@link #getPreInstalledPluginsPath()} (to remove in IDEA 14) */ - @SuppressWarnings({"UnusedDeclaration", "MethodNamesDifferingOnlyByCase", "SpellCheckingInspection"}) - public static String getPreinstalledPluginsPath() { - return getPreInstalledPluginsPath(); - } - - /** @deprecated use {@link #getConfigPath()} (to remove in IDEA 14) */ - @SuppressWarnings("UnusedDeclaration") - public static String getConfigPath(boolean createIfNotExists) { - ensureConfigFolderExists(); - return ourConfigPath; - } - - /** @deprecated use {@link #ensureConfigFolderExists()} (to remove in IDEA 14) */ - @SuppressWarnings("UnusedDeclaration") - public static boolean ensureConfigFolderExists(boolean createIfNotExists) { - return checkAndCreate(getConfigPath(), createIfNotExists); - } - - /** @deprecated use {@link #getOptionsPath()} (to remove in IDEA 14) */ - @SuppressWarnings("UnusedDeclaration") - public static String getOptionsPathWithoutDialog() { - return getOptionsPath(); - } - - /** @deprecated use {@link #getOptionsFile(String)} (to remove in IDEA 14) */ - @SuppressWarnings("UnusedDeclaration") - public static File getDefaultOptionsFile() { - return new File(getOptionsPath(), DEFAULT_OPTIONS_FILE_NAME + ".xml"); - } } diff --git a/platform/util/src/com/intellij/openapi/diagnostic/Log.java b/platform/util/src/com/intellij/openapi/diagnostic/Log.java deleted file mode 100644 index 842a8356f591..000000000000 --- a/platform/util/src/com/intellij/openapi/diagnostic/Log.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2000-2014 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.intellij.openapi.diagnostic; - -import java.util.ArrayList; -import java.util.List; - -/** @deprecated use {@link com.intellij.openapi.diagnostic.Logger} (to be removed in IDEA 15) */ -@SuppressWarnings("unused") -public class Log { - private static final List myStrings = new ArrayList(); - private static final List myThrowables = new ArrayList(); - private static final Object LOCK = new Object(); - - private Log() { } - - public static void print(String text) { - print(text, false); - } - - public static void print(String text, boolean trace) { - synchronized (LOCK) { - myStrings.add(text); - myThrowables.add(trace ? new Exception() : null); - } - } - - @SuppressWarnings({"ThrowableResultOfMethodCallIgnored", "UseOfSystemOutOrSystemErr"}) - public static void flush() { - synchronized (LOCK) { - for (int i = 0; i < myStrings.size(); i++) { - String each = myStrings.get(i); - Throwable trace = myThrowables.get(i); - System.out.println(each); - if (trace != null) { - trace.printStackTrace(System.out); - } - } - myStrings.clear(); - myThrowables.clear(); - } - } -} diff --git a/platform/util/src/com/intellij/openapi/util/JDOMUtil.java b/platform/util/src/com/intellij/openapi/util/JDOMUtil.java index 3574cbefce6b..ce2acdafdc93 100644 --- a/platform/util/src/com/intellij/openapi/util/JDOMUtil.java +++ b/platform/util/src/com/intellij/openapi/util/JDOMUtil.java @@ -135,19 +135,6 @@ public class JDOMUtil { return i * 31 + s.hashCode(); } - @SuppressWarnings("unused") - @NotNull - @Deprecated - /** - * to remove in IDEA 15 - */ - public static Object[] getChildNodesWithAttrs(@NotNull Element e) { - ArrayList result = new ArrayList(); - result.addAll(e.getContent()); - result.addAll(e.getAttributes()); - return ArrayUtil.toObjectArray(result); - } - @NotNull public static Content[] getContent(@NotNull Element m) { List list = m.getContent(); diff --git a/platform/util/src/com/intellij/openapi/util/SystemInfo.java b/platform/util/src/com/intellij/openapi/util/SystemInfo.java index 7fb56ca27b97..84c2aec7a4f8 100644 --- a/platform/util/src/com/intellij/openapi/util/SystemInfo.java +++ b/platform/util/src/com/intellij/openapi/util/SystemInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -131,9 +131,6 @@ public class SystemInfo extends SystemInfoRt { return ourHasXdgOpen.getValue(); } - /** @deprecated useless (to remove in IDEA 14) */ - public static final boolean isIntelMac = isMac && "i386".equals(OS_ARCH); - public static final boolean isMacOSTiger = isMac && isOsVersionAtLeast("10.4"); public static final boolean isMacOSLeopard = isMac && isOsVersionAtLeast("10.5"); public static final boolean isMacOSSnowLeopard = isMac && isOsVersionAtLeast("10.6"); diff --git a/platform/util/src/com/intellij/openapi/util/io/FileSystemUtil.java b/platform/util/src/com/intellij/openapi/util/io/FileSystemUtil.java index e91a9b5c6a69..4f731e8be362 100644 --- a/platform/util/src/com/intellij/openapi/util/io/FileSystemUtil.java +++ b/platform/util/src/com/intellij/openapi/util/io/FileSystemUtil.java @@ -169,26 +169,6 @@ public class FileSystemUtil { return resolveSymLink(file.getAbsolutePath()); } - /** @deprecated use {@link #clonePermissions(String, String)} (to remove in IDEA 14) */ - @SuppressWarnings("UnusedDeclaration") - public static int getPermissions(@NotNull String path) { - return -1; - } - - /** @deprecated use {@link #clonePermissions(String, String)} (to remove in IDEA 14) */ - @SuppressWarnings("UnusedDeclaration") - public static int getPermissions(@NotNull File file) { - return -1; - } - - /** @deprecated use {@link #clonePermissions(String, String)} (to remove in IDEA 14) */ - @SuppressWarnings("UnusedDeclaration") - public static void setPermissions(@NotNull String path, int permissions) { } - - /** @deprecated use {@link #clonePermissions(String, String)} (to remove in IDEA 14) */ - @SuppressWarnings({"UnusedDeclaration", "deprecation"}) - public static void setPermissions(@NotNull File file, int permissions) { } - /** * Gives the second file permissions of the first one if possible; returns true if succeed. * Will do nothing on Windows. diff --git a/platform/util/src/com/intellij/openapi/util/io/FileUtil.java b/platform/util/src/com/intellij/openapi/util/io/FileUtil.java index 16b47c2f17e4..6ebe7727dc8c 100644 --- a/platform/util/src/com/intellij/openapi/util/io/FileUtil.java +++ b/platform/util/src/com/intellij/openapi/util/io/FileUtil.java @@ -1484,24 +1484,6 @@ public class FileUtil extends FileUtilRt { return FileUtilRt.loadLines(reader); } - /** @deprecated unclear closing policy, do not use (to remove in IDEA 14) */ - @SuppressWarnings({"UnusedDeclaration", "deprecation"}) - public static List loadLines(@NotNull InputStream stream) throws IOException { - return loadLines(new InputStreamReader(stream)); - } - - /** @deprecated unclear closing policy, do not use (to remove in IDEA 14) */ - @SuppressWarnings("UnusedDeclaration") - public static List loadLines(@NotNull Reader reader) throws IOException { - BufferedReader bufferedReader = new BufferedReader(reader); - try { - return loadLines(bufferedReader); - } - finally { - bufferedReader.close(); - } - } - @NotNull public static byte[] loadBytes(@NotNull InputStream stream) throws IOException { return FileUtilRt.loadBytes(stream); diff --git a/platform/util/src/com/intellij/openapi/util/text/StringUtil.java b/platform/util/src/com/intellij/openapi/util/text/StringUtil.java index 93f7166daff4..d6409ccb9e06 100644 --- a/platform/util/src/com/intellij/openapi/util/text/StringUtil.java +++ b/platform/util/src/com/intellij/openapi/util/text/StringUtil.java @@ -940,27 +940,6 @@ public class StringUtil extends StringUtilRt { return true; } - /** - * @deprecated use {@link #startsWithConcatenation(String, String...)} (to remove in IDEA 14). - */ - @SuppressWarnings("UnusedDeclaration") - @Contract(pure = true) - public static boolean startsWithConcatenationOf(@NotNull String string, @NotNull String firstPrefix, @NotNull String secondPrefix) { - return startsWithConcatenation(string, firstPrefix, secondPrefix); - } - - /** - * @deprecated use {@link #startsWithConcatenation(String, String...)} (to remove in IDEA 14). - */ - @SuppressWarnings("UnusedDeclaration") - @Contract(pure = true) - public static boolean startsWithConcatenationOf(@NotNull String string, - @NotNull String firstPrefix, - @NotNull String secondPrefix, - @NotNull String thirdPrefix) { - return startsWithConcatenation(string, firstPrefix, secondPrefix, thirdPrefix); - } - @Contract(value = "null -> null; !null -> !null", pure = true) public static String trim(@Nullable String s) { return s == null ? null : s.trim(); diff --git a/platform/util/src/com/intellij/util/EnvironmentUtil.java b/platform/util/src/com/intellij/util/EnvironmentUtil.java index 19961bfc0b89..97fdcb1517e4 100644 --- a/platform/util/src/com/intellij/util/EnvironmentUtil.java +++ b/platform/util/src/com/intellij/util/EnvironmentUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -243,18 +243,6 @@ public class EnvironmentUtil { } } - /** @deprecated use {@link #getEnvironmentMap()} (to remove in IDEA 14) */ - @SuppressWarnings({"UnusedDeclaration", "SpellCheckingInspection"}) - public static Map getEnviromentProperties() { - return getEnvironmentMap(); - } - - /** @deprecated use {@link #getEnvironmentMap()} (to remove in IDEA 14) */ - @SuppressWarnings({"UnusedDeclaration", "SpellCheckingInspection"}) - public static Map getEnvironmentProperties() { - return getEnvironmentMap(); - } - public static void inlineParentOccurrences(@NotNull Map envs) { Map parentParams = new HashMap(System.getenv()); for (Map.Entry entry : envs.entrySet()) { diff --git a/platform/util/src/com/intellij/util/IncorrectOperationException.java b/platform/util/src/com/intellij/util/IncorrectOperationException.java index aeaaf726f553..55d4dfd08e1a 100644 --- a/platform/util/src/com/intellij/util/IncorrectOperationException.java +++ b/platform/util/src/com/intellij/util/IncorrectOperationException.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,9 +33,4 @@ public class IncorrectOperationException extends RuntimeException { public IncorrectOperationException(@NonNls String message, Throwable t) { super(message, t); } - - /** @deprecated use {@link #IncorrectOperationException(String, Throwable)} (to be removed in IDEA 15) */ - public IncorrectOperationException(@NonNls String message, Exception e) { - super(message, e); - } } diff --git a/platform/util/src/com/intellij/util/MemoryDumpHelper.java b/platform/util/src/com/intellij/util/MemoryDumpHelper.java index a3ec1639f8b1..6f42800e4901 100644 --- a/platform/util/src/com/intellij/util/MemoryDumpHelper.java +++ b/platform/util/src/com/intellij/util/MemoryDumpHelper.java @@ -1,3 +1,18 @@ +/* + * Copyright 2000-2015 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.intellij.util; import com.intellij.openapi.diagnostic.Logger; @@ -77,10 +92,4 @@ public class MemoryDumpHelper { public static synchronized void captureMemoryDump(@NotNull String dumpPath) throws Exception { ourDumpHeap.invoke(ourMXBean, dumpPath, true); } - - /** @deprecated use {@link #captureMemoryDump(String)} (to be removed in IDEA 15) */ - @SuppressWarnings({"UnusedDeclaration", "SpellCheckingInspection"}) - public static Object getHotspotMBean() { - return ourMXBean; - } } diff --git a/platform/util/src/com/intellij/util/cls/BytePointer.java b/platform/util/src/com/intellij/util/cls/BytePointer.java deleted file mode 100644 index 58322ff65713..000000000000 --- a/platform/util/src/com/intellij/util/cls/BytePointer.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2000-2011 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.intellij.util.cls; - -/** @deprecated to be removed in IDEA 15 */ -public class BytePointer { - public final byte[] bytes; - public int offset; - - public BytePointer(byte[] bytes, int offset) { - this.bytes = bytes; - this.offset = offset; - } -} diff --git a/platform/util/src/com/intellij/util/cls/ClsUtil.java b/platform/util/src/com/intellij/util/cls/ClsUtil.java deleted file mode 100644 index 95e1fcb2d87f..000000000000 --- a/platform/util/src/com/intellij/util/cls/ClsUtil.java +++ /dev/null @@ -1,380 +0,0 @@ -/* - * Copyright 2000-2009 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.intellij.util.cls; - -import com.intellij.openapi.util.text.StringUtil; - -/** @deprecated to be removed in IDEA 15 */ -@SuppressWarnings("ALL") -public class ClsUtil { - public static final int MAGIC = 0xCAFEBABE; - - public static final int CONSTANT_Class = 7; - public static final int CONSTANT_Fieldref = 9; - public static final int CONSTANT_Methodref = 10; - public static final int CONSTANT_InterfaceMethodref = 11; - public static final int CONSTANT_String = 8; - public static final int CONSTANT_Integer = 3; - public static final int CONSTANT_Float = 4; - public static final int CONSTANT_Long = 5; - public static final int CONSTANT_Double = 6; - public static final int CONSTANT_NameAndType = 12; - public static final int CONSTANT_Utf8 = 1; - public static final int CONSTANT_MethodHandle = 15; - public static final int CONSTANT_MethodType = 16; - public static final int CONSTANT_InvokeDynamic = 18; - - public static final int ACC_PUBLIC = 0x0001; - public static final int ACC_PRIVATE = 0x0002; - public static final int ACC_PROTECTED = 0x0004; - public static final int ACC_STATIC = 0x0008; - public static final int ACC_FINAL = 0x0010; - public static final int ACC_SYNCHRONIZED = 0x0020; - public static final int ACC_BRIDGE = 0x0040; - public static final int ACC_VARARGS = 0x0080; - public static final int ACC_VOLATILE = 0x0040; - public static final int ACC_TRANSIENT = 0x0080; - public static final int ACC_NATIVE = 0x0100; - public static final int ACC_INTERFACE = 0x0200; - public static final int ACC_ABSTRACT = 0x0400; - public static final int ACC_SYNTHETIC = 0x1000; - public static final int ACC_ANNOTATION = 0x2000; - public static final int ACC_ENUM = 0x4000; - - /** - * Mask of access_flags that are meaningful in .class file format (VM Spec 4.1) - */ - public static final int ACC_CLASS_MASK = ACC_PUBLIC | ACC_FINAL | ACC_INTERFACE | ACC_ABSTRACT | ACC_STATIC | ACC_ANNOTATION; - - public static final int ACC_FIELD_MASK = ACC_PUBLIC | ACC_PRIVATE | ACC_PROTECTED | ACC_STATIC | ACC_FINAL | ACC_VOLATILE | ACC_TRANSIENT; - public static final int ACC_METHOD_MASK = ACC_PUBLIC | ACC_PRIVATE | ACC_PROTECTED | ACC_STATIC | ACC_FINAL | ACC_SYNCHRONIZED | ACC_BRIDGE | ACC_VARARGS | ACC_NATIVE | ACC_ABSTRACT; - private static final int POSITIVE_INFINITY_AS_INT = 0x7f800000; - private static final long POSITIVE_INFINITY_AS_LONG = 0x7f80000000000000L; - private static final int NEGATIVE_INFINITY_AS_INT = 0xff800000; - private static final long NEGATIVE_INFINITY_AS_LONG = 0xff80000000000000L; - - public static int readU1(BytePointer ptr) throws ClsFormatException { - if (ptr.offset < 0 || ptr.offset >= ptr.bytes.length) { - throw new ClsFormatException(); - } - return ptr.bytes[ptr.offset++] & 0xFF; - } - - public static int readU2(BytePointer ptr) throws ClsFormatException { - int b1 = readU1(ptr); - int b2 = readU1(ptr); - return (b1 << 8) + b2; - } - - public static int readU4(BytePointer ptr) throws ClsFormatException { - int b1 = readU1(ptr); - int b2 = readU1(ptr); - int b3 = readU1(ptr); - int b4 = readU1(ptr); - return (b1 << 24) + (b2 << 16) + (b3 << 8) + b4; - } - - public static long readU8(BytePointer ptr) throws ClsFormatException { - long b1 = readU1(ptr); - long b2 = readU1(ptr); - long b3 = readU1(ptr); - long b4 = readU1(ptr); - long b5 = readU1(ptr); - long b6 = readU1(ptr); - long b7 = readU1(ptr); - long b8 = readU1(ptr); - - return (b1 << 56) + (b2 << 48) + (b3 << 40) + (b4 << 32) + (b5 << 24) + (b6 << 16) + (b7 << 8) + b8; - } - - public static String readUtf8Info(BytePointer ptr) throws ClsFormatException { - return readUtf8Info(ptr, -1, -1); - } - - public static String readUtf8Info(BytePointer ptr, int oldChar, int newChar) throws ClsFormatException { - int tag = readU1(ptr); - if (tag != CONSTANT_Utf8) { - throw new ClsFormatException(); - } - int length = readU2(ptr); - return readUtf8(ptr.bytes, ptr.offset, ptr.offset + length, oldChar, newChar); - } - - public static String readUtf8Info(byte[] bytes, int startOffset) throws ClsFormatException { - int offset = startOffset; - if (offset + 3 > bytes.length) { - throw new ClsFormatException(); - } - int tag = bytes[offset++] & 0xFF; - if (tag != CONSTANT_Utf8) { - throw new ClsFormatException(); - } - int b1 = bytes[offset++] & 0xFF; - int b2 = bytes[offset++] & 0xFF; - int length = (b1 << 8) + b2; - if (offset + length > bytes.length) { - throw new ClsFormatException(); - } - return readUtf8(bytes, offset, offset + length); - } - - private static String readUtf8(byte[] bytes, int startOffset, int endOffset) throws ClsFormatException { - return readUtf8(bytes, startOffset, endOffset, -1, -1); - } - - private static String readUtf8(byte[] bytes, int startOffset, int endOffset, int oldChar, int newChar) throws ClsFormatException { - char[] buffer = new char[endOffset - startOffset]; - int bOffset = 0; - int offset = startOffset; - while (offset < endOffset) { - int b = bytes[offset++] & 0xFF; - if (b == 0 || b >= 0xF0) { - throw new ClsFormatException(); - } - if (b < 0x80) { - buffer[bOffset++] = (char) (b == oldChar ? newChar : b); - } else { - if (offset == endOffset) { - throw new ClsFormatException(); - } - int b1 = bytes[offset++] & 0xFF; - if ((b & 0x20) == 0) { - buffer[bOffset++] = (char) (((b & 0x1F) << 6) + (b1 & 0x3F)); - } else { - if (offset == endOffset) { - throw new ClsFormatException(); - } - int b2 = bytes[offset++] & 0xFF; - buffer[bOffset++] = (char) (((b & 0xF) << 12) + ((b1 & 0x3F) << 6) + (b2 & 0x3F)); - } - } - } - return new String(buffer, 0, bOffset); - } - - public static double readDouble(BytePointer ptr) throws ClsFormatException { - int high = readU4(ptr); - int low = readU4(ptr); - long longValue = ((long) high << 32) + low; - double doubleValue; - if (longValue == POSITIVE_INFINITY_AS_LONG) { - doubleValue = Double.POSITIVE_INFINITY; - } - else if (longValue == NEGATIVE_INFINITY_AS_LONG) { - doubleValue = Double.NEGATIVE_INFINITY; - } - else if (0x7ff0000000000001L <= longValue && longValue <= 0x7fffffffffffffffL) { - doubleValue = Double.NaN; - } - else if (0xfff0000000000001L <= longValue && longValue <= 0xffffffffffffffffL) { - doubleValue = Double.NaN; - } - else { - int s = ((longValue >> 63) == 0) ? 1 : -1; - int e = (int)((longValue >> 52) & 0x7ffL); - long m = (e == 0) ? ((longValue & 0xfffffffffffffL) << 1) : ((longValue & 0xfffffffffffffL) | 0x10000000000000L); - doubleValue = s * m * Math.pow(2, e - 1075); - } - return doubleValue; - } - - public static float readFloat(BytePointer ptr) throws ClsFormatException { - int value = readU4(ptr); - float floatValue; - if (value == POSITIVE_INFINITY_AS_INT) { - floatValue = Float.POSITIVE_INFINITY; - } else if (value == NEGATIVE_INFINITY_AS_INT) { - floatValue = Float.NEGATIVE_INFINITY; - } else if ((value >= 0x7f800001 && value <= 0x7fffffff) || (value >= 0xff800001 && value <= 0xffffffff)) { - floatValue = Float.NaN; - } else { - int s = ((value >> 31) == 0) ? 1 : -1; - int e = ((value >> 23) & 0xff); - int m = (e == 0) ? (value & 0x7fffff) << 1 : (value & 0x7fffff) | 0x800000; - floatValue = (float) (s * m * Math.pow(2, e - 150)); - } - return floatValue; - } - - public static void skipAttribute(BytePointer ptr) throws ClsFormatException { - ptr.offset += 2; - int length = readU4(ptr); - ptr.offset += length; - } - - public static void skipAttributes(BytePointer ptr) throws ClsFormatException { - int count = readU2(ptr); - for (int i = 0; i < count; i++) { - skipAttribute(ptr); - } - } - - @SuppressWarnings({"HardCodedStringLiteral"}) - public static String getTypeText(byte[] data, int offset) throws ClsFormatException { - int count = 0; - while (true) { - if (offset >= data.length) { - throw new ClsFormatException(); - } - if (data[offset] != '[') break; - offset++; - count++; - } - - String text; - switch ((char) data[offset]) { - default: - throw new ClsFormatException(); - - case 'B': - text = "byte"; - break; - - case 'C': - text = "char"; - break; - - case 'D': - text = "double"; - break; - - case 'F': - text = "float"; - break; - - case 'I': - text = "int"; - break; - - case 'J': - text = "long"; - break; - - case 'S': - text = "short"; - break; - - case 'Z': - text = "boolean"; - break; - - case 'V': - text = "void"; - break; - - case 'L': - int offset1 = offset + 1; - while (true) { - if (offset1 >= data.length) { - throw new ClsFormatException(); - } - if (data[offset1] == ';') break; - offset1++; - } - String className = readUtf8(data, offset + 1, offset1, '/', '.'); - text = convertClassName(className, false); - break; - } - - for (int i = 0; i < count; i++) { - text += "[]"; - } - - return text; - } - - public static int getTypeEndOffset(byte[] data, int startOffset) throws ClsFormatException { - int offset = startOffset; - while (true) { - if (offset >= data.length) { - throw new ClsFormatException(); - } - if (data[offset] != '[') break; - offset++; - } - if (data[offset++] == 'L') { - while (true) { - if (offset >= data.length) { - throw new ClsFormatException(); - } - if (data[offset++] == ';') break; - } - } - return offset; - } - - public static String convertClassName(String internalClassName, boolean convertSlashesToDots) { - String className = convertSlashesToDots ? internalClassName.replace('/', '.') : internalClassName; - int index = className.indexOf('$'); - if (index < 0) return className; - - StringBuilder buffer = new StringBuilder(className); - while(true){ - if (className.length() == index + 1) break; - char c = className.charAt(index + 1); - if (Character.isJavaIdentifierStart(c)){ - buffer.setCharAt(index, '.'); - } - index = className.indexOf('$', index + 1); - if (index < 0) break; - } - return buffer.toString(); - } - - public static boolean isPublic(int flags) { - return (ACC_PUBLIC & flags) != 0; - } - - public static boolean isProtected(int flags) { - return (ACC_PROTECTED & flags) != 0; - } - - public static boolean isPackageLocal(int flags) { - return !isPublic(flags) && !isProtected(flags) && !isPrivate(flags); - } - - public static boolean isPrivate(int flags) { - return (ACC_PRIVATE & flags) != 0; - } - - public static boolean isAbstract(int flags) { - return (ACC_ABSTRACT & flags) != 0; - } - - public static boolean isBridge(int flags) { - return (ACC_BRIDGE & flags) != 0; - } - - public static boolean isSynthetic(int flags) { - return (ACC_SYNTHETIC & flags) != 0; - } - - public static boolean isAnnotation(int flags) { - return (ACC_ANNOTATION & flags) != 0; - } - - public static boolean isFinal(int flags) { - return (ACC_FINAL & flags) != 0; - } - - public static boolean isStatic(int flags) { - return (ACC_STATIC & flags) != 0; - } - - public static String literalToString(CharSequence value, char quote) { - return quote + StringUtil.escapeStringCharacters(value.toString()) + quote; - } -} diff --git a/platform/util/src/com/intellij/util/containers/ContainerUtil.java b/platform/util/src/com/intellij/util/containers/ContainerUtil.java index f3b4cf877260..abcbd941d6d7 100644 --- a/platform/util/src/com/intellij/util/containers/ContainerUtil.java +++ b/platform/util/src/com/intellij/util/containers/ContainerUtil.java @@ -178,13 +178,6 @@ public class ContainerUtil extends ContainerUtilRt { return ContainerUtilRt.newArrayList(iterable); } - /** @deprecated Use {@link #newArrayListWithCapacity(int)} (to remove in IDEA 15) */ - @SuppressWarnings("deprecation") - @Contract(pure=true) - public static ArrayList newArrayListWithExpectedSize(int size) { - return ContainerUtilRt.newArrayListWithCapacity(size); - } - @NotNull @Contract(pure=true) public static ArrayList newArrayListWithCapacity(int size) { diff --git a/platform/util/src/com/intellij/util/containers/MultiMapBasedOnSet.java b/platform/util/src/com/intellij/util/containers/MultiMapBasedOnSet.java deleted file mode 100644 index 54c3efd0ca66..000000000000 --- a/platform/util/src/com/intellij/util/containers/MultiMapBasedOnSet.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2000-2014 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.intellij.util.containers; - -import org.jetbrains.annotations.NotNull; - -import java.util.Collection; -import java.util.Collections; - -@Deprecated -/** - * @author Sergey Evdokimov - * @deprecated Please use {@link MultiMap#createSet()} - * to remove in IDEA 15 - */ -public class MultiMapBasedOnSet extends MultiMap { - - @NotNull - @Override - protected Collection createCollection() { - return new HashSet(); - } - - @NotNull - @Override - protected Collection createEmptyCollection() { - return Collections.emptySet(); - } - - @NotNull - public static MultiMap createBasedOnSet() { - return MultiMap.createSet(); - } - -} diff --git a/platform/util/src/com/intellij/util/lang/UrlClassLoader.java b/platform/util/src/com/intellij/util/lang/UrlClassLoader.java index 18bbc369a82c..20b5a5fe4706 100644 --- a/platform/util/src/com/intellij/util/lang/UrlClassLoader.java +++ b/platform/util/src/com/intellij/util/lang/UrlClassLoader.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -146,26 +146,6 @@ public class UrlClassLoader extends ClassLoader { .usePersistentClasspathIndexForLocalClassDirectories()); } - /** @deprecated use {@link #build()} (to remove in IDEA 15) */ - public UrlClassLoader(List urls, @Nullable ClassLoader parent) { - this(build().urls(urls).parent(parent)); - } - - /** @deprecated use {@link #build()} (to remove in IDEA 15) */ - public UrlClassLoader(URL[] urls, @Nullable ClassLoader parent) { - this(build().urls(urls).parent(parent)); - } - - /** @deprecated use {@link #build()} (to remove in IDEA 15) */ - public UrlClassLoader(List urls, @Nullable ClassLoader parent, boolean lockJars, boolean useCache) { - this(build().urls(urls).parent(parent).allowLock(lockJars).useCache(useCache)); - } - - /** @deprecated use {@link #build()} (to remove in IDEA 15) */ - public UrlClassLoader(List urls, @Nullable ClassLoader parent, boolean lockJars, boolean useCache, boolean allowUnescaped, boolean preload) { - this(build().urls(urls).parent(parent).allowLock(lockJars).useCache(useCache).allowUnescaped(allowUnescaped).preload(preload)); - } - protected UrlClassLoader(@NotNull Builder builder) { super(builder.myParent); myURLs = ContainerUtil.map(builder.myURLs, new Function() { diff --git a/platform/util/src/com/intellij/util/ui/UIUtil.java b/platform/util/src/com/intellij/util/ui/UIUtil.java index f48ed7465161..8120a64369b2 100644 --- a/platform/util/src/com/intellij/util/ui/UIUtil.java +++ b/platform/util/src/com/intellij/util/ui/UIUtil.java @@ -786,18 +786,6 @@ public class UIUtil { return UIManager.getColor("Label.disabledText"); } - /** @deprecated to remove in IDEA 14 */ - @SuppressWarnings("UnusedDeclaration") - public static Icon getOptionPanelWarningIcon() { - return getWarningIcon(); - } - - /** @deprecated to remove in IDEA 14 */ - @SuppressWarnings("UnusedDeclaration") - public static Icon getOptionPanelQuestionIcon() { - return getQuestionIcon(); - } - @NotNull public static String removeMnemonic(@NotNull String s) { if (s.indexOf('&') != -1) { diff --git a/platform/vcs-api/vcs-api-core/src/com/intellij/openapi/diff/impl/patch/TextFilePatch.java b/platform/vcs-api/vcs-api-core/src/com/intellij/openapi/diff/impl/patch/TextFilePatch.java index 02dbac240421..13234d5d7735 100644 --- a/platform/vcs-api/vcs-api-core/src/com/intellij/openapi/diff/impl/patch/TextFilePatch.java +++ b/platform/vcs-api/vcs-api-core/src/com/intellij/openapi/diff/impl/patch/TextFilePatch.java @@ -26,22 +26,18 @@ import java.util.List; * @author yole */ public class TextFilePatch extends FilePatch { - @Nullable private Charset myCharset; + private Charset myCharset; private final List myHunks; - public void addHunk(final PatchHunk hunk) { - myHunks.add(hunk); - } - - public List getHunks() { - return Collections.unmodifiableList(myHunks); - } - public TextFilePatch(@Nullable Charset charset) { myCharset = charset; myHunks = new ArrayList(); } + public TextFilePatch pathsOnlyCopy() { + return new TextFilePatch(this); + } + private TextFilePatch(final TextFilePatch patch) { myCharset = patch.myCharset; setBeforeVersionId(patch.getBeforeVersionId()); @@ -51,10 +47,15 @@ public class TextFilePatch extends FilePatch { myHunks = patch.myHunks; } - public TextFilePatch pathsOnlyCopy() { - return new TextFilePatch(this); + public void addHunk(final PatchHunk hunk) { + myHunks.add(hunk); } + public List getHunks() { + return Collections.unmodifiableList(myHunks); + } + + @Override public boolean isNewFile() { return myHunks.size() == 1 && myHunks.get(0).isNewContent(); } @@ -63,6 +64,7 @@ public class TextFilePatch extends FilePatch { return myHunks.get(0).getText(); } + @Override public boolean isDeletedFile() { return myHunks.size() == 1 && myHunks.get(0).isDeletedContent(); } @@ -71,12 +73,4 @@ public class TextFilePatch extends FilePatch { public Charset getCharset() { return myCharset; } - - /** - * To be removed in IDEA 15 - */ - @Deprecated - public void setCharset(@Nullable Charset charset) { - myCharset = charset; - } }