1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-09 09:15:38 +02:00

Cosmetics.

This commit is contained in:
Sergey Prigogin 2015-01-08 16:54:27 -08:00
parent dfacdf9d40
commit 765d9bf16e

View file

@ -413,8 +413,7 @@ public class PDOMManager implements IWritableIndexManager, IListener {
return LanguageManager.getInstance().getPDOMLinkageFactoryMappings(); return LanguageManager.getInstance().getPDOMLinkageFactoryMappings();
} }
private void storeDatabaseName(IProject rproject, String dbName) private void storeDatabaseName(IProject rproject, String dbName) throws CoreException {
throws CoreException {
rproject.setPersistentProperty(dbNameProperty, dbName); rproject.setPersistentProperty(dbNameProperty, dbName);
} }
@ -838,7 +837,7 @@ public class PDOMManager implements IWritableIndexManager, IListener {
IPDOMIndexer indexer; IPDOMIndexer indexer;
synchronized (fUpdatePolicies) { synchronized (fUpdatePolicies) {
// Prevent recreating the indexer // Prevent recreating the indexer.
fClosingProjects.add(name); fClosingProjects.add(name);
indexer= getIndexer(cproject); indexer= getIndexer(cproject);
} }
@ -850,7 +849,7 @@ public class PDOMManager implements IWritableIndexManager, IListener {
Object pdom= null; Object pdom= null;
synchronized (fProjectToPDOM) { synchronized (fProjectToPDOM) {
pdom = fProjectToPDOM.remove(rproject); pdom = fProjectToPDOM.remove(rproject);
// if the project is closed allow to reuse the pdom. // If the project is closed allow to reuse the pdom.
if (pdom instanceof WritablePDOM && !delete) { if (pdom instanceof WritablePDOM && !delete) {
fFileToProject.remove(((WritablePDOM) pdom).getDB().getLocation()); fFileToProject.remove(((WritablePDOM) pdom).getDB().getLocation());
} }
@ -1264,7 +1263,8 @@ public class PDOMManager implements IWritableIndexManager, IListener {
} }
// Overwrite internal location representations. // Overwrite internal location representations.
final WritablePDOM newPDOM = new WritablePDOM(targetLocation, pdom.getLocationConverter(), getLinkageFactories()); final WritablePDOM newPDOM =
new WritablePDOM(targetLocation, pdom.getLocationConverter(), getLinkageFactories());
newPDOM.acquireWriteLock(null); newPDOM.acquireWriteLock(null);
try { try {
newPDOM.rewriteLocations(newConverter); newPDOM.rewriteLocations(newConverter);
@ -1290,7 +1290,8 @@ public class PDOMManager implements IWritableIndexManager, IListener {
* @throws OperationCanceledException in case the thread was interrupted * @throws OperationCanceledException in case the thread was interrupted
* @since 4.0 * @since 4.0
*/ */
public void importProjectPDOM(ICProject project, InputStream stream, IProgressMonitor monitor) throws CoreException, IOException { public void importProjectPDOM(ICProject project, InputStream stream, IProgressMonitor monitor)
throws CoreException, IOException {
// make a copy of the database // make a copy of the database
String newName= createNewDatabaseName(project); String newName= createNewDatabaseName(project);
File newFile= fileFromDatabaseName(newName); File newFile= fileFromDatabaseName(newName);
@ -1303,11 +1304,13 @@ public class PDOMManager implements IWritableIndexManager, IListener {
out.write(b); out.write(b);
} }
if (version > PDOM.getMaxSupportedVersion()) { if (version > PDOM.getMaxSupportedVersion()) {
final IStatus status = new Status(IStatus.WARNING, CCorePlugin.PLUGIN_ID, 0, CCorePlugin.getResourceString("PDOMManager.unsupportedHigherVersion"), null); //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, CCorePlugin.PLUGIN_ID, 0,
CCorePlugin.getResourceString("PDOMManager.unsupportedHigherVersion"), null); //$NON-NLS-1$
throw new CoreException(status); throw new CoreException(status);
} }
if (!PDOM.isSupportedVersion(version)) { if (!PDOM.isSupportedVersion(version)) {
final IStatus status = new Status(IStatus.WARNING, CCorePlugin.PLUGIN_ID, 0, CCorePlugin.getResourceString("PDOMManager.unsupportedVersion"), null); //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, CCorePlugin.PLUGIN_ID, 0,
CCorePlugin.getResourceString("PDOMManager.unsupportedVersion"), null); //$NON-NLS-1$
throw new CoreException(status); throw new CoreException(status);
} }
byte[] buffer= new byte[2048]; byte[] buffer= new byte[2048];