mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Cleanup (warning)
This commit is contained in:
+3
-14
@@ -25,7 +25,6 @@ import com.intellij.openapi.projectRoots.Sdk;
|
||||
import com.intellij.openapi.roots.*;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.vfs.encoding.EncodingProjectManager;
|
||||
import com.intellij.util.NotNullFunction;
|
||||
import com.intellij.util.PathsList;
|
||||
import com.intellij.util.text.VersionComparatorUtil;
|
||||
import org.intellij.lang.annotations.MagicConstant;
|
||||
@@ -94,16 +93,6 @@ public class JavaParameters extends SimpleJavaParameters {
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private static NotNullFunction<OrderEntry, VirtualFile[]> computeRootProvider(@MagicConstant(valuesFromClass = JavaParameters.class) int classPathType, final Sdk jdk) {
|
||||
return (classPathType & JDK_ONLY) == 0 ? null : (NotNullFunction<OrderEntry, VirtualFile[]>)orderEntry -> {
|
||||
if (orderEntry instanceof JdkOrderEntry) {
|
||||
return jdk.getRootProvider().getFiles(OrderRootType.CLASSES);
|
||||
}
|
||||
return orderEntry.getFiles(OrderRootType.CLASSES);
|
||||
};
|
||||
}
|
||||
|
||||
public void setDefaultCharset(final Project project) {
|
||||
Charset encoding = EncodingProjectManager.getInstance(project).getDefaultCharset();
|
||||
setCharset(encoding);
|
||||
@@ -189,9 +178,9 @@ public class JavaParameters extends SimpleJavaParameters {
|
||||
enumerator = enumerator.productionOnly();
|
||||
}
|
||||
OrderRootsEnumerator rootsEnumerator = enumerator.classes();
|
||||
final NotNullFunction<OrderEntry, VirtualFile[]> provider = computeRootProvider(classPathType, jdk);
|
||||
if (provider != null) {
|
||||
rootsEnumerator = rootsEnumerator.usingCustomRootProvider(provider);
|
||||
if ((classPathType & JDK_ONLY) != 0) {
|
||||
rootsEnumerator = rootsEnumerator.usingCustomRootProvider(
|
||||
e -> e instanceof JdkOrderEntry ? jdk.getRootProvider().getFiles(OrderRootType.CLASSES) : e.getFiles(OrderRootType.CLASSES));
|
||||
}
|
||||
return rootsEnumerator;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user