mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[by cdr] optimizations
This commit is contained in:
@@ -17,6 +17,7 @@ package org.jetbrains.jps.incremental;
|
||||
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.io.FileUtilRt;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jps.builders.BuildTarget;
|
||||
@@ -94,7 +95,7 @@ public class Utils {
|
||||
|
||||
public static URI toURI(String localPath) {
|
||||
try {
|
||||
String p = FileUtil.toSystemIndependentName(localPath);
|
||||
String p = FileUtilRt.toSystemIndependentName(localPath);
|
||||
if (!p.startsWith("/")) {
|
||||
p = "/" + p;
|
||||
}
|
||||
|
||||
@@ -224,9 +224,11 @@ class OptimizedFileManager17 extends com.sun.tools.javac.file.JavacFileManager {
|
||||
return fileKinds.contains(getKind(name));
|
||||
}
|
||||
|
||||
private class InputFileObject extends BaseFileObject {
|
||||
private static class InputFileObject extends BaseFileObject {
|
||||
private static final Kind[] ourAvailableKinds = Kind.values();
|
||||
private final String name;
|
||||
private final File file;
|
||||
private final Kind kind;
|
||||
private Reference<File> absFileRef;
|
||||
|
||||
public InputFileObject(JavacFileManager fileManager, File f) {
|
||||
@@ -237,9 +239,9 @@ class OptimizedFileManager17 extends com.sun.tools.javac.file.JavacFileManager {
|
||||
super(fileManager);
|
||||
this.name = name;
|
||||
this.file = f;
|
||||
kind = findKind(name);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public URI toUri() {
|
||||
try {
|
||||
@@ -262,7 +264,11 @@ class OptimizedFileManager17 extends com.sun.tools.javac.file.JavacFileManager {
|
||||
|
||||
@Override
|
||||
public JavaFileObject.Kind getKind() {
|
||||
for (Kind kind : Kind.values()) {
|
||||
return kind;
|
||||
}
|
||||
|
||||
private static JavaFileObject.Kind findKind(String name) {
|
||||
for (Kind kind : ourAvailableKinds) {
|
||||
if (kind != Kind.OTHER && name.endsWith(kind.extension)) {
|
||||
return kind;
|
||||
}
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user