Remove getCanonicalFile on the LS side

This commit is contained in:
BoykoAlex
2019-05-02 12:48:08 -04:00
parent 473c8a1b78
commit 6163411e3f
3 changed files with 20 additions and 22 deletions

View File

@@ -67,7 +67,6 @@ public class IClasspathUtil {
}
private static boolean correspondsToBinaryLocation(CPE cpe, File classpathEntryFile) {
classpathEntryFile = canonicalFile(classpathEntryFile);
File canonicalFile = binaryLocation(cpe);
return Objects.equals(canonicalFile, classpathEntryFile);
}
@@ -75,30 +74,14 @@ public class IClasspathUtil {
public static File binaryLocation(CPE cpe) {
switch (cpe.getKind()) {
case Classpath.ENTRY_KIND_BINARY:
return canonicalFile(cpe.getPath());
return new File(cpe.getPath());
case Classpath.ENTRY_KIND_SOURCE:
return canonicalFile(cpe.getOutputFolder());
return new File(cpe.getOutputFolder());
default:
throw new IllegalStateException("Missing switch case?");
}
}
private static File canonicalFile(String _f) {
if (_f!=null) {
File f = new File(_f);
return canonicalFile(f);
}
return null;
}
private static File canonicalFile(File f) {
try {
return f.getCanonicalFile();
} catch (IOException e) {
return f.getAbsoluteFile();
}
}
public static Stream<File> getSourceFolders(IClasspath classpath) {
try {
if (classpath != null) {