mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-09 09:15:38 +02:00
Cosmetics.
This commit is contained in:
parent
dfacdf9d40
commit
765d9bf16e
1 changed files with 13 additions and 10 deletions
|
@ -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,24 +1290,27 @@ 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);
|
||||||
OutputStream out= new FileOutputStream(newFile);
|
OutputStream out= new FileOutputStream(newFile);
|
||||||
try {
|
try {
|
||||||
int version= 0;
|
int version= 0;
|
||||||
for (int i=0; i<4; i++) {
|
for (int i= 0; i < 4; i++) {
|
||||||
byte b= (byte) stream.read();
|
byte b= (byte) stream.read();
|
||||||
version= (version << 8) + (b & 0xff);
|
version= (version << 8) + (b & 0xff);
|
||||||
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];
|
||||||
|
|
Loading…
Add table
Reference in a new issue