diff --git a/core/org.eclipse.cdt.core/browser/org/eclipse/cdt/core/browser/IndexTypeInfo.java b/core/org.eclipse.cdt.core/browser/org/eclipse/cdt/core/browser/IndexTypeInfo.java index dffea585819..832b54fc73e 100644 --- a/core/org.eclipse.cdt.core/browser/org/eclipse/cdt/core/browser/IndexTypeInfo.java +++ b/core/org.eclipse.cdt.core/browser/org/eclipse/cdt/core/browser/IndexTypeInfo.java @@ -344,17 +344,15 @@ public class IndexTypeInfo implements ITypeInfo, IFunctionInfo { String fullPath = ifl.getFullPath(); if (fullPath != null) { IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(fullPath)); - if(file!=null) { - return new IndexTypeReference( - binding, file, file.getProject(), indexName.getNodeOffset(), indexName.getNodeLength() - ); + if (file != null) { + return new IndexTypeReference(binding, file, file.getProject(), indexName.getNodeOffset(), + indexName.getNodeLength()); } } else { IPath path = URIUtil.toPath(ifl.getURI()); - if(path!=null) { - return new IndexTypeReference( - binding, path, null, indexName.getNodeOffset(), indexName.getNodeLength() - ); + if (path != null) { + return new IndexTypeReference(binding, path, null, indexName.getNodeOffset(), + indexName.getNodeLength()); } } return null; diff --git a/core/org.eclipse.cdt.core/browser/org/eclipse/cdt/internal/core/browser/ASTTypeInfo.java b/core/org.eclipse.cdt.core/browser/org/eclipse/cdt/internal/core/browser/ASTTypeInfo.java index 358197a586f..ac65ebc7d4a 100644 --- a/core/org.eclipse.cdt.core/browser/org/eclipse/cdt/internal/core/browser/ASTTypeInfo.java +++ b/core/org.eclipse.cdt.core/browser/org/eclipse/cdt/internal/core/browser/ASTTypeInfo.java @@ -192,13 +192,13 @@ public class ASTTypeInfo implements ITypeInfo, IFunctionInfo { String fullPath= ifl.getFullPath(); if (fullPath != null) { IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(fullPath)); - if(file!=null) { + if (file != null) { return new ASTTypeReference(ifl, name.resolveBinding(), file, floc.getNodeOffset(), floc.getNodeLength()); } } else { IPath path = URIUtil.toPath(ifl.getURI()); - if (path!=null) { + if (path != null) { return new ASTTypeReference(ifl, name.resolveBinding(), path, floc.getNodeOffset(), floc.getNodeLength()); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/index/IndexLocationFactory.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/index/IndexLocationFactory.java index 5cf1c2969cb..a9622127611 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/index/IndexLocationFactory.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/index/IndexLocationFactory.java @@ -12,20 +12,16 @@ *******************************************************************************/ package org.eclipse.cdt.core.index; -import java.io.File; import java.net.URI; import org.eclipse.cdt.core.model.ICProject; import org.eclipse.cdt.core.model.ITranslationUnit; import org.eclipse.cdt.internal.core.index.IndexFileLocation; import org.eclipse.cdt.internal.core.resources.ResourceLookup; -import org.eclipse.core.filesystem.EFS; -import org.eclipse.core.filesystem.IFileStore; import org.eclipse.core.filesystem.URIUtil; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.Path; @@ -65,21 +61,7 @@ public class IndexLocationFactory { * if the location is not a filesystem path. */ public static IPath getAbsolutePath(IIndexFileLocation location) { - IPath path = URIUtil.toPath(location.getURI()); - // Workaround for platform bug http://bugs.eclipse.org/bugs/show_bug.cgi?id=261457 - if (path == null) { - try { - IFileStore store = EFS.getStore(location.getURI()); - if (store == null) - return null; - File file = store.toLocalFile(EFS.NONE, null); - if (file == null) - return null; - path = new Path(file.getAbsolutePath()); - } catch (CoreException e) { - } - } - return path; + return URIUtil.toPath(location.getURI()); } /** diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/EFSFileStorage.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/EFSFileStorage.java index 2242b83d727..b44be2f75ad 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/EFSFileStorage.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/EFSFileStorage.java @@ -48,14 +48,12 @@ public class EFSFileStorage extends PlatformObject implements IStorage { IFileStore fileStore = EFS.getStore(locationURI); if (fileStore != null) { - inputStream = fileStore.openInputStream(EFS.NONE, new NullProgressMonitor()); } } return inputStream; - } /* (non-Javadoc) @@ -120,7 +118,7 @@ public class EFSFileStorage extends PlatformObject implements IStorage { @Override public boolean equals(Object obj) { if (obj instanceof EFSFileStorage && locationURI != null) { - return locationURI.equals(((EFSFileStorage)obj).getLocationURI()); + return locationURI.equals(((EFSFileStorage) obj).getLocationURI()); } return false; }