diff options
author | Sergey Prigogin | 2012-04-17 03:47:52 +0000 |
---|---|---|
committer | Sergey Prigogin | 2012-04-18 02:55:24 +0000 |
commit | 94759400896aae11394ae0cec398b53fbe09a1ba (patch) | |
tree | 11e19b012e6f7647e544702516115a1f831e0999 | |
parent | 0e6e83e1cbbf8ea77962bfd0803500a978933b93 (diff) | |
download | org.eclipse.cdt-94759400896aae11394ae0cec398b53fbe09a1ba.tar.gz org.eclipse.cdt-94759400896aae11394ae0cec398b53fbe09a1ba.tar.xz org.eclipse.cdt-94759400896aae11394ae0cec398b53fbe09a1ba.zip |
Fixed a compiler warning.
-rw-r--r-- | core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMManager.java | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMManager.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMManager.java index 09a72dba2c4..a7ffd73770b 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMManager.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMManager.java @@ -20,7 +20,6 @@ import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; -import java.nio.channels.FileChannel; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; @@ -1206,42 +1205,41 @@ public class PDOMManager implements IWritableIndexManager, IListener { if (!deleted) { throw new IllegalArgumentException( MessageFormat.format(Messages.PDOMManager_ExistingFileCollides, - new Object[] {targetLocation}) - ); + targetLocation )); } } try { - // copy it + // Copy it. PDOM pdom= getOrCreatePDOM(cproject); pdom.acquireReadLock(); String oldID= null; try { oldID= pdom.getProperty(IIndexFragment.PROPERTY_FRAGMENT_ID); pdom.flush(); - FileChannel to = new FileOutputStream(targetLocation).getChannel(); - pdom.getDB().transferTo(to); - to.close(); + FileOutputStream stream = new FileOutputStream(targetLocation); + pdom.getDB().transferTo(stream.getChannel()); + stream.close(); } finally { pdom.releaseReadLock(); } - // overwrite internal location representations + // Overwrite internal location representations. final WritablePDOM newPDOM = new WritablePDOM(targetLocation, pdom.getLocationConverter(), getLinkageFactories()); newPDOM.acquireWriteLock(); try { newPDOM.rewriteLocations(newConverter); - // ensure fragment id has a sensible value, in case callee's do not - // overwrite their own values - newPDOM.setProperty(IIndexFragment.PROPERTY_FRAGMENT_ID, "exported."+oldID); //$NON-NLS-1$ + // Ensure that fragment id has a sensible value, in case callee's do not + // overwrite with their own values. + newPDOM.setProperty(IIndexFragment.PROPERTY_FRAGMENT_ID, "exported." + oldID); //$NON-NLS-1$ newPDOM.close(); } finally { newPDOM.releaseWriteLock(); } - } catch (IOException ioe) { - throw new CoreException(CCorePlugin.createStatus(ioe.getMessage())); - } catch (InterruptedException ie) { - throw new CoreException(CCorePlugin.createStatus(ie.getMessage())); + } catch (IOException e) { + throw new CoreException(CCorePlugin.createStatus(e.getMessage())); + } catch (InterruptedException e) { + throw new CoreException(CCorePlugin.createStatus(e.getMessage())); } } |