1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 17:56:01 +02:00

Removed workaround for bug 261457, which has been fixed in the platform.

This commit is contained in:
Sergey Prigogin 2009-05-16 23:24:32 +00:00
parent c5c0fc6d24
commit 2ef51ed6f7
4 changed files with 10 additions and 32 deletions

View file

@ -345,16 +345,14 @@ public class IndexTypeInfo implements ITypeInfo, IFunctionInfo {
if (fullPath != null) { if (fullPath != null) {
IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(fullPath)); IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(fullPath));
if (file != null) { if (file != null) {
return new IndexTypeReference( return new IndexTypeReference(binding, file, file.getProject(), indexName.getNodeOffset(),
binding, file, file.getProject(), indexName.getNodeOffset(), indexName.getNodeLength() indexName.getNodeLength());
);
} }
} else { } else {
IPath path = URIUtil.toPath(ifl.getURI()); IPath path = URIUtil.toPath(ifl.getURI());
if (path != null) { if (path != null) {
return new IndexTypeReference( return new IndexTypeReference(binding, path, null, indexName.getNodeOffset(),
binding, path, null, indexName.getNodeOffset(), indexName.getNodeLength() indexName.getNodeLength());
);
} }
} }
return null; return null;

View file

@ -12,20 +12,16 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.index; package org.eclipse.cdt.core.index;
import java.io.File;
import java.net.URI; import java.net.URI;
import org.eclipse.cdt.core.model.ICProject; import org.eclipse.cdt.core.model.ICProject;
import org.eclipse.cdt.core.model.ITranslationUnit; import org.eclipse.cdt.core.model.ITranslationUnit;
import org.eclipse.cdt.internal.core.index.IndexFileLocation; import org.eclipse.cdt.internal.core.index.IndexFileLocation;
import org.eclipse.cdt.internal.core.resources.ResourceLookup; 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.filesystem.URIUtil;
import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Path;
@ -65,21 +61,7 @@ public class IndexLocationFactory {
* if the location is not a filesystem path. * if the location is not a filesystem path.
*/ */
public static IPath getAbsolutePath(IIndexFileLocation location) { public static IPath getAbsolutePath(IIndexFileLocation location) {
IPath path = URIUtil.toPath(location.getURI()); return 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;
} }
/** /**

View file

@ -48,14 +48,12 @@ public class EFSFileStorage extends PlatformObject implements IStorage {
IFileStore fileStore = EFS.getStore(locationURI); IFileStore fileStore = EFS.getStore(locationURI);
if (fileStore != null) { if (fileStore != null) {
inputStream = fileStore.openInputStream(EFS.NONE, inputStream = fileStore.openInputStream(EFS.NONE,
new NullProgressMonitor()); new NullProgressMonitor());
} }
} }
return inputStream; return inputStream;
} }
/* (non-Javadoc) /* (non-Javadoc)