From 0cfc0bf16457c975775d8134d8374d97acb30790 Mon Sep 17 00:00:00 2001 From: Sergey Prigogin Date: Mon, 10 Aug 2009 04:22:10 +0000 Subject: [PATCH] Cosmetics. --- .../cdt/internal/core/pdom/WritablePDOM.java | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/WritablePDOM.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/WritablePDOM.java index f192329038f..20a798c835d 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/WritablePDOM.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/WritablePDOM.java @@ -65,8 +65,7 @@ public class WritablePDOM extends PDOM implements IWritableIndexFragment { fPathResolver= pathResolver; try { pdomFile.addNames(names); - } - finally { + } finally { 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) */ public void setProperty(String propertyName, String value) throws CoreException { - if(IIndexFragment.PROPERTY_FRAGMENT_FORMAT_ID.equals(propertyName) - || IIndexFragment.PROPERTY_FRAGMENT_FORMAT_VERSION.equals(propertyName)) { + if (IIndexFragment.PROPERTY_FRAGMENT_FORMAT_ID.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$ } 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 { final List pdomfiles = new ArrayList(); - getFileIndex().accept(new IBTreeVisitor(){ + getFileIndex().accept(new IBTreeVisitor() { public int compare(long record) throws CoreException { return 0; } @@ -131,7 +130,7 @@ public class WritablePDOM extends PDOM implements IWritableIndexFragment { final List notConverted = new ArrayList(); for (PDOMFile file : pdomfiles) { String internalFormat = newConverter.toInternalFormat(file.getLocation()); - if(internalFormat!=null) { + if (internalFormat != null) { file.setInternalLocation(internalFormat); getFileIndex().insert(file.getRecord()); } else { @@ -139,7 +138,6 @@ public class WritablePDOM extends PDOM implements IWritableIndexFragment { } } - // remove content where converter returns null for (PDOMFile file : notConverted) { file.convertIncludersToUnresolved(); @@ -169,10 +167,8 @@ public class WritablePDOM extends PDOM implements IWritableIndexFragment { } public PDOMFile getFileForASTPath(int linkageID, String astPath) throws CoreException { - if (fPathResolver != null) { - if (astPath != null) { - return getFile(linkageID, fPathResolver.resolveASTPath(astPath)); - } + if (fPathResolver != null && astPath != null) { + return getFile(linkageID, fPathResolver.resolveASTPath(astPath)); } return null; }