1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Fixed an NPE.

This commit is contained in:
Sergey Prigogin 2011-10-17 11:22:14 -07:00
parent 72db9fbe93
commit ffb7162210

View file

@ -677,20 +677,20 @@ public class PDOMFile implements IIndexFragmentFile {
return result.toArray(new IIndexName[result.size()]); return result.toArray(new IIndexName[result.size()]);
} }
public static PDOMFile[] findFiles(PDOMLinkage linkage, BTree btree, IIndexFileLocation location, public static IIndexFragmentFile[] findFiles(PDOMLinkage linkage, BTree btree, IIndexFileLocation location,
IIndexLocationConverter strategy) throws CoreException { IIndexLocationConverter strategy) throws CoreException {
String internalRepresentation= strategy.toInternalFormat(location); String internalRepresentation= strategy.toInternalFormat(location);
if (internalRepresentation != null) { if (internalRepresentation != null) {
Finder finder = new Finder(linkage.getDB(), internalRepresentation, linkage.getLinkageID(), null); Finder finder = new Finder(linkage.getDB(), internalRepresentation, linkage.getLinkageID(), null);
btree.accept(finder); btree.accept(finder);
long[] records= finder.getRecords(); long[] records= finder.getRecords();
PDOMFile[] result= new PDOMFile[records.length]; IIndexFragmentFile[] result= new IIndexFragmentFile[records.length];
for (int i = 0; i < result.length; i++) { for (int i = 0; i < result.length; i++) {
result[i]= new PDOMFile(linkage, records[i]); result[i]= new PDOMFile(linkage, records[i]);
} }
return result; return result;
} }
return null; return IIndexFragmentFile.EMPTY_ARRAY;
} }
/** /**