Cleanup (deprecated API; warnings; typos; formatting)

GitOrigin-RevId: 1cae1c5c763d76758bec79763f2a7f20c12defe8
This commit is contained in:
Roman Shevchenko
2019-09-12 16:46:43 +02:00
committed by intellij-monorepo-bot
parent 32c96ffa03
commit 1ad030183c
11 changed files with 34 additions and 204 deletions

View File

@@ -1,16 +1,12 @@
/*
* Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.openapi.projectRoots;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
/** @deprecated use {@link JavaSdkVersion#fromVersionString} (to be removed in IDEA 2019) */
@Deprecated
public class JdkVersionUtil {
/** @deprecated use {@link JavaSdkVersion#fromVersionString} (to be removed in IDEA 2019) */
@ApiStatus.ScheduledForRemoval(inVersion = "2019")
/** @deprecated use {@link JavaSdkVersion#fromVersionString} */
@ApiStatus.ScheduledForRemoval(inVersion = "2021.1")
@Deprecated
public static JavaSdkVersion getVersion(@NotNull String versionString) {
return JavaSdkVersion.fromVersionString(versionString);

View File

@@ -1,23 +1,8 @@
/*
* Copyright 2000-2017 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.
*/
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.psi.scope;
import com.intellij.psi.*;
import com.intellij.psi.filters.ElementFilter;
import org.jetbrains.annotations.ApiStatus;
/**
* @author max
@@ -65,11 +50,4 @@ public class ElementClassFilter implements ElementFilter {
public boolean isClassAcceptable(Class hintClass) {
return true;
}
//<editor-fold desc="Deprecated stuff.">
/** @deprecated use {@linkplain #PACKAGE} (to be removed in IDEA 2018) */
@ApiStatus.ScheduledForRemoval(inVersion = "2018")
@Deprecated
public static final ElementClassFilter PACKAGE_FILTER = PACKAGE;
//</editor-fold>
}

View File

@@ -1,10 +1,9 @@
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package org.jetbrains.jps.model.java;
import com.intellij.openapi.util.Bitness;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.util.lang.JavaVersion;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jps.service.JpsServiceManager;
@@ -19,24 +18,6 @@ public abstract class JdkVersionDetector {
return JpsServiceManager.getInstance().getService(JdkVersionDetector.class);
}
/** @deprecated use {@link #detectJdkVersionInfo(String)} (to be removed in IDEA 2019) */
@ApiStatus.ScheduledForRemoval(inVersion = "2019")
@Deprecated
@Nullable
public String detectJdkVersion(@NotNull String homePath) {
JdkVersionInfo info = detectJdkVersionInfo(homePath);
return info != null ? info.getVersion() : null;
}
/** @deprecated use {@link #detectJdkVersionInfo(String, ExecutorService)} (to be removed in IDEA 2019) */
@ApiStatus.ScheduledForRemoval(inVersion = "2019")
@Deprecated
@Nullable
public String detectJdkVersion(@NotNull String homePath, @NotNull ExecutorService runner) {
JdkVersionInfo info = detectJdkVersionInfo(homePath, runner);
return info != null ? info.getVersion() : null;
}
@Nullable
public abstract JdkVersionInfo detectJdkVersionInfo(@NotNull String homePath);
@@ -56,20 +37,6 @@ public abstract class JdkVersionDetector {
public String toString() {
return version + " " + bitness;
}
/** @deprecated use {@link #version} (to be removed in IDEA 2019) */
@ApiStatus.ScheduledForRemoval(inVersion = "2019")
@Deprecated
public String getVersion() {
return formatVersionString(version);
}
/** @deprecated use {@link #bitness} (to be removed in IDEA 2019) */
@ApiStatus.ScheduledForRemoval(inVersion = "2019")
@Deprecated
public Bitness getBitness() {
return bitness;
}
}
public static String formatVersionString(@NotNull JavaVersion version) {

View File

@@ -1,23 +1,8 @@
/*
* Copyright 2000-2016 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.
*/
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.openapi.application;
import com.intellij.openapi.project.Project;
import com.intellij.util.ThrowableRunnable;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
public abstract class BaseActionRunnable<T> {
@@ -49,11 +34,4 @@ public abstract class BaseActionRunnable<T> {
mySilentExecution = true;
return execute();
}
/** @deprecated use {@link ApplicationManager#getApplication()} (to be removed in IDEA 2018) */
@Deprecated
@ApiStatus.ScheduledForRemoval(inVersion = "2018")
protected Application getApplication() {
return ApplicationManager.getApplication();
}
}

View File

@@ -59,7 +59,7 @@ public class JdkUtil {
private JdkUtil() { }
/**
* Returns the specified attribute of the JDK (examines rt.jar), or {@code null} if cannot determine the value.
* Returns the specified attribute of the JDK (examines 'rt.jar'), or {@code null} if cannot determine the value.
*/
@Nullable
public static String getJdkMainAttribute(@NotNull Sdk jdk, @NotNull Attributes.Name attribute) {
@@ -166,7 +166,7 @@ public class JdkUtil {
boolean dynamicParameters = dynamicClasspath && javaParameters.isDynamicParameters() && useDynamicParameters();
boolean dynamicMainClass = false;
//copy javaagents to the beginning of the classpath to load agent classes faster
// copies 'javaagent' .jar files to the beginning of the classpath to load agent classes faster
if (isUrlClassloader(vmParameters)) {
for (String parameter : vmParameters.getParameters()) {
if (parameter.startsWith(JAVAAGENT)) {
@@ -177,7 +177,7 @@ public class JdkUtil {
}
if (dynamicClasspath) {
Class commandLineWrapper;
Class<?> commandLineWrapper;
if (javaParameters.isArgFile()) {
setArgFileParams(commandLine, javaParameters, vmParameters, dynamicVMOptions, dynamicParameters);
dynamicMainClass = dynamicParameters;
@@ -303,7 +303,7 @@ public class JdkUtil {
private static void setCommandLineWrapperParams(@NotNull GeneralCommandLine commandLine,
@NotNull SimpleJavaParameters javaParameters,
@NotNull ParametersList vmParameters,
@NotNull Class commandLineWrapper,
@NotNull Class<?> commandLineWrapper,
boolean dynamicVMOptions,
boolean dynamicParameters) throws CantRunException {
try {
@@ -398,7 +398,7 @@ public class JdkUtil {
private static void setClasspathJarParams(@NotNull GeneralCommandLine commandLine,
@NotNull SimpleJavaParameters javaParameters,
@NotNull ParametersList vmParameters,
@NotNull Class commandLineWrapper,
@NotNull Class<?> commandLineWrapper,
boolean dynamicVMOptions,
boolean dynamicParameters) throws CantRunException {
try {
@@ -457,7 +457,7 @@ public class JdkUtil {
}
private static void throwUnableToCreateTempFile(@NotNull IOException cause) throws CantRunException {
throw new CantRunException("Failed to a create temporary file in " + FileUtilRt.getTempDirectory(), cause);
throw new CantRunException("Failed to create a temporary file in " + FileUtilRt.getTempDirectory(), cause);
}
private static void appendParamsEncodingClasspath(@NotNull SimpleJavaParameters javaParameters,
@@ -483,7 +483,7 @@ public class JdkUtil {
private static void appendEncoding(@NotNull SimpleJavaParameters javaParameters,
@NotNull GeneralCommandLine commandLine,
@NotNull ParametersList parametersList) {
// Value of file.encoding and charset of GeneralCommandLine should be in sync in order process's input and output be correctly handled.
// for correct handling of process's input and output, values of file.encoding and charset of GeneralCommandLine should be in sync
String encoding = parametersList.getPropertyValue("file.encoding");
if (encoding == null) {
Charset charset = javaParameters.getCharset();
@@ -520,7 +520,7 @@ public class JdkUtil {
}
@Nullable
private static Class getCommandLineWrapperClass() {
private static Class<?> getCommandLineWrapperClass() {
try {
return Class.forName(WRAPPER_CLASS);
}
@@ -549,13 +549,10 @@ public class JdkUtil {
}
//<editor-fold desc="Deprecated stuff.">
/** @deprecated use {@link SimpleJavaParameters#toCommandLine()} (to be removed in IDEA 2018) */
@ApiStatus.ScheduledForRemoval(inVersion = "2018")
/** @deprecated use {@link SimpleJavaParameters#toCommandLine()} */
@ApiStatus.ScheduledForRemoval(inVersion = "2021.1")
@Deprecated
public static GeneralCommandLine setupJVMCommandLine(final String exePath,
final SimpleJavaParameters javaParameters,
final boolean forceDynamicClasspath) {
public static GeneralCommandLine setupJVMCommandLine(String exePath, SimpleJavaParameters javaParameters, boolean forceDynamicClasspath) {
try {
javaParameters.setUseDynamicClasspath(forceDynamicClasspath);
GeneralCommandLine commandLine = new GeneralCommandLine(exePath);

View File

@@ -1,6 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.openapi.projectRoots.impl;
import com.intellij.util.concurrency.AppExecutorUtil;
@@ -15,12 +13,13 @@ import org.jetbrains.jps.model.java.JdkVersionDetector;
public class SdkVersionUtil {
private SdkVersionUtil() { }
/** @deprecated use {@link #getJdkVersionInfo(String)} (to be removed in IDEA 2019) */
@ApiStatus.ScheduledForRemoval(inVersion = "2019")
/** @deprecated use {@link #getJdkVersionInfo(String)} */
@Deprecated
@ApiStatus.ScheduledForRemoval(inVersion = "2021.1")
@Nullable
public static String detectJdkVersion(@NotNull String homePath) {
return JdkVersionDetector.getInstance().detectJdkVersion(homePath, AppExecutorUtil.getAppExecutorService());
JdkVersionDetector.JdkVersionInfo info = getJdkVersionInfo(homePath);
return info != null ? JdkVersionDetector.formatVersionString(info.version) : null;
}
@Nullable

View File

@@ -1,18 +1,4 @@
/*
* Copyright 2000-2016 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.
*/
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.find.findUsages;
import com.intellij.ide.DataManager;
@@ -159,10 +145,10 @@ public abstract class FindUsagesHandler {
return isSearchForTextOccurencesAvailable(psiElement, isSingleFile);
}
/** @deprecated use/override {@link #isSearchForTextOccurrencesAvailable(PsiElement, boolean)} instead (to be removed in IDEA 18) */
/** @deprecated use/override {@link #isSearchForTextOccurrencesAvailable(PsiElement, boolean)} instead */
@Deprecated
@SuppressWarnings("SpellCheckingInspection")
@ApiStatus.ScheduledForRemoval(inVersion = "2018")
@ApiStatus.ScheduledForRemoval(inVersion = "2021.1")
@SuppressWarnings({"SpellCheckingInspection", "DeprecatedIsStillUsed", "unused"})
protected boolean isSearchForTextOccurencesAvailable(@NotNull PsiElement psiElement, boolean isSingleFile) {
return false;
}

View File

@@ -65,19 +65,16 @@ public abstract class HierarchyBrowserBaseEx extends HierarchyBrowserBase implem
public static final String HELP_ID = "reference.toolWindows.hierarchy";
/** @deprecated (to be removed in IDEA 2018) */
@ApiStatus.ScheduledForRemoval(inVersion = "2018")
@Deprecated protected final Hashtable<String, HierarchyTreeBuilder> myBuilders = new Hashtable<>();
/** @deprecated use {@link #getCurrentViewType()} (to be removed in IDEA 2018) */
@ApiStatus.ScheduledForRemoval(inVersion = "2018")
/** @deprecated use {@link #getCurrentViewType()} */
@Deprecated
@ApiStatus.ScheduledForRemoval(inVersion = "2021.1")
@SuppressWarnings("DeprecatedIsStillUsed")
protected String myCurrentViewType;
private static class Sheet implements Disposable {
private AsyncTreeModel myAsyncTreeModel;
private StructureTreeModel myStructureTreeModel;
@NotNull private final String myType;
private final @NotNull String myType;
private final JTree myTree;
private String myScope;
private final OccurenceNavigator myOccurenceNavigator;

View File

@@ -1,31 +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.ide.hierarchy;
import com.intellij.ide.util.treeView.AbstractTreeBuilder;
import org.jetbrains.annotations.ApiStatus;
/**
* @deprecated (to be removed in IDEA 2018)
*/
@ApiStatus.ScheduledForRemoval(inVersion = "2018")
@Deprecated
public class HierarchyTreeBuilder extends AbstractTreeBuilder {
HierarchyTreeBuilder() {
throw new IllegalStateException();
}
}

View File

@@ -10,7 +10,7 @@ import java.util.*;
/**
* @author dsl
*/
public class CachingSemiGraph<Node> implements GraphGenerator.SemiGraph<Node> {
public class CachingSemiGraph<Node> implements InboundSemiGraph<Node> {
public static <T> InboundSemiGraph<T> cache(InboundSemiGraph<T> original) {
return new CachingSemiGraph<>(original);
}
@@ -45,5 +45,4 @@ public class CachingSemiGraph<Node> implements GraphGenerator.SemiGraph<Node> {
? inNodes.iterator()
: ContainerUtil.emptyIterator();
}
}

View File

@@ -1,25 +1,10 @@
/*
* Copyright 2000-2017 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.
*/
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.util.graph;
import com.intellij.openapi.util.Pair;
import com.intellij.util.containers.ContainerUtil;
import gnu.trove.THashMap;
import gnu.trove.THashSet;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import java.util.*;
@@ -82,28 +67,7 @@ public class GraphGenerator<Node> implements Graph<Node> {
@NotNull
@Override
public Iterator<Node> getOut(Node n) {
final List<Node> outNodes = myOuts.get(n);
return outNodes != null
? outNodes.iterator()
: ContainerUtil.emptyIterator();
List<Node> outNodes = myOuts.get(n);
return outNodes != null ? outNodes.iterator() : ContainerUtil.emptyIterator();
}
//<editor-fold desc="Deprecated stuff.">
public interface SemiGraph<Node> extends InboundSemiGraph<Node> {
@Override
@NotNull
Collection<Node> getNodes();
@NotNull
@Override
Iterator<Node> getIn(Node n);
}
/** @deprecated use {@link #generate(InboundSemiGraph)} (to be removed in IDEA 2018) */
@ApiStatus.ScheduledForRemoval(inVersion = "2018")
@Deprecated
public static <T> GraphGenerator<T> create(SemiGraph<T> graph) {
return new GraphGenerator<>(graph);
}
//</editor-fold>
}