mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Cleanup (dead code; warnings; formatting)
This commit is contained in:
@@ -161,7 +161,6 @@ public class JavaSdkImpl extends JavaSdk {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("HardCodedStringLiteral")
|
||||
public String getBinPath(@NotNull Sdk sdk) {
|
||||
return getConvertedHomePath(sdk) + "bin";
|
||||
}
|
||||
@@ -372,7 +371,6 @@ public class JavaSdkImpl extends JavaSdk {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("HardCodedStringLiteral")
|
||||
public void setupSdkPaths(@NotNull Sdk sdk) {
|
||||
String homePath = sdk.getHomePath();
|
||||
assert homePath != null : sdk;
|
||||
@@ -488,11 +486,6 @@ public class JavaSdkImpl extends JavaSdk {
|
||||
return versionString;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(@NotNull String versionString, @NotNull String versionNumber) {
|
||||
return getVersionNumber(versionString).compareTo(versionNumber);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JavaSdkVersion getVersion(@NotNull Sdk sdk) {
|
||||
String version = sdk.getVersionString();
|
||||
@@ -676,7 +669,7 @@ public class JavaSdkImpl extends JavaSdk {
|
||||
ContainerUtil.addIfNotNull(result, fileManager.findFileByUrl(url));
|
||||
}
|
||||
|
||||
Collections.sort(result, (o1, o2) -> o1.getPath().compareTo(o2.getPath()));
|
||||
Collections.sort(result, Comparator.comparing(VirtualFile::getPath));
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -689,13 +682,11 @@ public class JavaSdkImpl extends JavaSdk {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@SuppressWarnings("HardCodedStringLiteral")
|
||||
private static VirtualFile findSources(File file) {
|
||||
return findSources(file, "src");
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@SuppressWarnings("HardCodedStringLiteral")
|
||||
private static VirtualFile findSources(File file, final String srcName) {
|
||||
File jarFile = new File(file, srcName + ".jar");
|
||||
if (!jarFile.exists()) {
|
||||
@@ -717,7 +708,6 @@ public class JavaSdkImpl extends JavaSdk {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("HardCodedStringLiteral")
|
||||
private static void addDocs(File file, SdkModificator rootContainer) {
|
||||
VirtualFile vFile = findDocs(file, "docs/api");
|
||||
if (vFile != null) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
* 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.
|
||||
@@ -17,33 +17,27 @@ package com.intellij.openapi.projectRoots;
|
||||
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.projectRoots.impl.SdkVersionUtil;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public abstract class JavaSdk extends SdkType implements JavaSdkType {
|
||||
public JavaSdk(@NotNull @NonNls String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
public static JavaSdk getInstance() {
|
||||
return ApplicationManager.getApplication().getComponent(JavaSdk.class);
|
||||
}
|
||||
|
||||
public JavaSdk(@NotNull String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public final Sdk createJdk(@NotNull String jdkName, @NotNull String jreHome) {
|
||||
return createJdk(jdkName, jreHome, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use {@link #isOfVersionOrHigher(Sdk, JavaSdkVersion)} instead
|
||||
*/
|
||||
public abstract int compareTo(@NotNull String versionString, @NotNull String versionNumber);
|
||||
|
||||
@NotNull
|
||||
public abstract Sdk createJdk(@NonNls String jdkName, @NotNull String home, boolean isJre);
|
||||
public abstract Sdk createJdk(String jdkName, @NotNull String home, boolean isJre);
|
||||
|
||||
@Nullable
|
||||
public abstract JavaSdkVersion getVersion(@NotNull Sdk sdk);
|
||||
@@ -65,4 +59,4 @@ public abstract class JavaSdk extends SdkType implements JavaSdkType {
|
||||
public static String getJdkVersion(@NotNull String sdkHome) {
|
||||
return SdkVersionUtil.detectJdkVersion(sdkHome);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user