mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-06 01:06:01 +02:00
Removed workaround for bug 261457, which has been fixed in the platform.
This commit is contained in:
parent
c5c0fc6d24
commit
2ef51ed6f7
4 changed files with 10 additions and 32 deletions
|
@ -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;
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue