1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-04 06:45:43 +02:00

Cosmetics.

This commit is contained in:
Sergey Prigogin 2009-08-10 04:22:10 +00:00
parent 01f10e61af
commit 0cfc0bf164

View file

@ -65,8 +65,7 @@ public class WritablePDOM extends PDOM implements IWritableIndexFragment {
fPathResolver= pathResolver; fPathResolver= pathResolver;
try { try {
pdomFile.addNames(names); pdomFile.addNames(names);
} } finally {
finally {
fPathResolver= origResolver; fPathResolver= origResolver;
} }
@ -97,8 +96,8 @@ public class WritablePDOM extends PDOM implements IWritableIndexFragment {
* @see org.eclipse.cdt.internal.core.index.IWritableIndexFragment#setProperty(java.lang.String, java.lang.String) * @see org.eclipse.cdt.internal.core.index.IWritableIndexFragment#setProperty(java.lang.String, java.lang.String)
*/ */
public void setProperty(String propertyName, String value) throws CoreException { public void setProperty(String propertyName, String value) throws CoreException {
if(IIndexFragment.PROPERTY_FRAGMENT_FORMAT_ID.equals(propertyName) if (IIndexFragment.PROPERTY_FRAGMENT_FORMAT_ID.equals(propertyName)
|| IIndexFragment.PROPERTY_FRAGMENT_FORMAT_VERSION.equals(propertyName)) { || IIndexFragment.PROPERTY_FRAGMENT_FORMAT_VERSION.equals(propertyName)) {
throw new IllegalArgumentException("Property "+value+" may not be written to"); //$NON-NLS-1$ //$NON-NLS-2$ throw new IllegalArgumentException("Property "+value+" may not be written to"); //$NON-NLS-1$ //$NON-NLS-2$
} }
new DBProperties(db, PROPERTIES).setProperty(propertyName, value); new DBProperties(db, PROPERTIES).setProperty(propertyName, value);
@ -116,7 +115,7 @@ public class WritablePDOM extends PDOM implements IWritableIndexFragment {
*/ */
public void rewriteLocations(final IIndexLocationConverter newConverter) throws CoreException { public void rewriteLocations(final IIndexLocationConverter newConverter) throws CoreException {
final List<PDOMFile> pdomfiles = new ArrayList<PDOMFile>(); final List<PDOMFile> pdomfiles = new ArrayList<PDOMFile>();
getFileIndex().accept(new IBTreeVisitor(){ getFileIndex().accept(new IBTreeVisitor() {
public int compare(long record) throws CoreException { public int compare(long record) throws CoreException {
return 0; return 0;
} }
@ -131,7 +130,7 @@ public class WritablePDOM extends PDOM implements IWritableIndexFragment {
final List<PDOMFile> notConverted = new ArrayList<PDOMFile>(); final List<PDOMFile> notConverted = new ArrayList<PDOMFile>();
for (PDOMFile file : pdomfiles) { for (PDOMFile file : pdomfiles) {
String internalFormat = newConverter.toInternalFormat(file.getLocation()); String internalFormat = newConverter.toInternalFormat(file.getLocation());
if(internalFormat!=null) { if (internalFormat != null) {
file.setInternalLocation(internalFormat); file.setInternalLocation(internalFormat);
getFileIndex().insert(file.getRecord()); getFileIndex().insert(file.getRecord());
} else { } else {
@ -139,7 +138,6 @@ public class WritablePDOM extends PDOM implements IWritableIndexFragment {
} }
} }
// remove content where converter returns null // remove content where converter returns null
for (PDOMFile file : notConverted) { for (PDOMFile file : notConverted) {
file.convertIncludersToUnresolved(); file.convertIncludersToUnresolved();
@ -169,10 +167,8 @@ public class WritablePDOM extends PDOM implements IWritableIndexFragment {
} }
public PDOMFile getFileForASTPath(int linkageID, String astPath) throws CoreException { public PDOMFile getFileForASTPath(int linkageID, String astPath) throws CoreException {
if (fPathResolver != null) { if (fPathResolver != null && astPath != null) {
if (astPath != null) { return getFile(linkageID, fPathResolver.resolveASTPath(astPath));
return getFile(linkageID, fPathResolver.resolveASTPath(astPath));
}
} }
return null; return null;
} }