Lines 100-105
Link Here
|
100 |
import org.netbeans.modules.cnd.apt.support.IncludeDirEntry; |
100 |
import org.netbeans.modules.cnd.apt.support.IncludeDirEntry; |
101 |
import org.netbeans.modules.cnd.apt.support.PostIncludeData; |
101 |
import org.netbeans.modules.cnd.apt.support.PostIncludeData; |
102 |
import org.netbeans.modules.cnd.apt.support.StartEntry; |
102 |
import org.netbeans.modules.cnd.apt.support.StartEntry; |
|
|
103 |
import org.netbeans.modules.cnd.apt.utils.APTSerializeUtils; |
103 |
import org.netbeans.modules.cnd.apt.utils.APTUtils; |
104 |
import org.netbeans.modules.cnd.apt.utils.APTUtils; |
104 |
import org.netbeans.modules.cnd.debug.DebugUtils; |
105 |
import org.netbeans.modules.cnd.debug.DebugUtils; |
105 |
import org.netbeans.modules.cnd.modelimpl.cache.impl.WeakContainer; |
106 |
import org.netbeans.modules.cnd.modelimpl.cache.impl.WeakContainer; |
Lines 167-173
Link Here
|
167 |
protected ProjectBase(ModelImpl model, FileSystem fs, Object platformProject, String name) { |
168 |
protected ProjectBase(ModelImpl model, FileSystem fs, Object platformProject, String name) { |
168 |
namespaces = new ConcurrentHashMap<CharSequence, CsmUID<CsmNamespace>>(); |
169 |
namespaces = new ConcurrentHashMap<CharSequence, CsmUID<CsmNamespace>>(); |
169 |
this.uniqueName = getUniqueName(fs, platformProject); |
170 |
this.uniqueName = getUniqueName(fs, platformProject); |
170 |
RepositoryUtils.openUnit(createProjectKey(fs, platformProject)); |
171 |
Key key = createProjectKey(fs, platformProject); |
|
|
172 |
RepositoryUtils.openUnit(key); |
173 |
unitId = key.getUnitId(); |
171 |
setStatus(Status.Initial); |
174 |
setStatus(Status.Initial); |
172 |
this.name = ProjectNameCache.getManager().getString(name); |
175 |
this.name = ProjectNameCache.getManager().getString(name); |
173 |
this.fileSystem = fs; |
176 |
this.fileSystem = fs; |
Lines 3362-3367
Link Here
|
3362 |
private final AtomicBoolean disposing = new AtomicBoolean(false); |
3365 |
private final AtomicBoolean disposing = new AtomicBoolean(false); |
3363 |
private final ReadWriteLock disposeLock = new ReentrantReadWriteLock(); |
3366 |
private final ReadWriteLock disposeLock = new ReentrantReadWriteLock(); |
3364 |
private final CharSequence uniqueName; |
3367 |
private final CharSequence uniqueName; |
|
|
3368 |
private final int unitId; |
3365 |
private final Map<CharSequence, CsmUID<CsmNamespace>> namespaces; |
3369 |
private final Map<CharSequence, CsmUID<CsmNamespace>> namespaces; |
3366 |
private final Key classifierStorageKey; |
3370 |
private final Key classifierStorageKey; |
3367 |
|
3371 |
|
Lines 3399-3409
Link Here
|
3399 |
@Override |
3403 |
@Override |
3400 |
public void write(RepositoryDataOutput aStream) throws IOException { |
3404 |
public void write(RepositoryDataOutput aStream) throws IOException { |
3401 |
assert aStream != null; |
3405 |
assert aStream != null; |
|
|
3406 |
aStream.writeInt(unitId); |
3402 |
PersistentUtils.writeFileSystem(fileSystem, aStream); |
3407 |
PersistentUtils.writeFileSystem(fileSystem, aStream); |
3403 |
UIDObjectFactory aFactory = UIDObjectFactory.getDefaultFactory(); |
3408 |
UIDObjectFactory aFactory = UIDObjectFactory.getDefaultFactory(); |
3404 |
assert aFactory != null; |
3409 |
assert aFactory != null; |
3405 |
assert this.name != null; |
3410 |
assert this.name != null; |
3406 |
PersistentUtils.writeUTF(name, aStream); |
3411 |
APTSerializeUtils.writeFileNameIndex(name, aStream, unitId); |
3407 |
//PersistentUtils.writeUTF(RepositoryUtils.getUnitName(getUID()), aStream); |
3412 |
//PersistentUtils.writeUTF(RepositoryUtils.getUnitName(getUID()), aStream); |
3408 |
aFactory.writeUID(this.globalNamespaceUID, aStream); |
3413 |
aFactory.writeUID(this.globalNamespaceUID, aStream); |
3409 |
aFactory.writeStringToUIDMap(this.namespaces, aStream, false); |
3414 |
aFactory.writeStringToUIDMap(this.namespaces, aStream, false); |
Lines 3414-3425
Link Here
|
3414 |
ProjectComponent.writeKey(classifierStorageKey, aStream); |
3419 |
ProjectComponent.writeKey(classifierStorageKey, aStream); |
3415 |
this.includedFileContainer.write(aStream); |
3420 |
this.includedFileContainer.write(aStream); |
3416 |
|
3421 |
|
3417 |
PersistentUtils.writeUTF(this.uniqueName, aStream); |
3422 |
APTSerializeUtils.writeFileNameIndex(this.uniqueName, aStream, unitId); |
3418 |
aStream.writeBoolean(hasFileSystemProblems); |
3423 |
aStream.writeBoolean(hasFileSystemProblems); |
3419 |
} |
3424 |
} |
3420 |
|
3425 |
|
3421 |
protected ProjectBase(RepositoryDataInput aStream) throws IOException { |
3426 |
protected ProjectBase(RepositoryDataInput aStream) throws IOException { |
3422 |
|
3427 |
unitId = aStream.readInt(); |
3423 |
fileSystem = PersistentUtils.readFileSystem(aStream); |
3428 |
fileSystem = PersistentUtils.readFileSystem(aStream); |
3424 |
sysAPTData = APTSystemStorage.getInstance(); |
3429 |
sysAPTData = APTSystemStorage.getInstance(); |
3425 |
userPathStorage = new APTIncludePathStorage(); |
3430 |
userPathStorage = new APTIncludePathStorage(); |
Lines 3430-3436
Link Here
|
3430 |
UIDObjectFactory aFactory = UIDObjectFactory.getDefaultFactory(); |
3435 |
UIDObjectFactory aFactory = UIDObjectFactory.getDefaultFactory(); |
3431 |
assert aFactory != null : "default UID factory can not be bull"; |
3436 |
assert aFactory != null : "default UID factory can not be bull"; |
3432 |
|
3437 |
|
3433 |
this.name = PersistentUtils.readUTF(aStream, ProjectNameCache.getManager()); |
3438 |
this.name = APTSerializeUtils.readFileNameIndex(aStream, ProjectNameCache.getManager(), unitId); |
3434 |
assert this.name != null : "project name can not be null"; |
3439 |
assert this.name != null : "project name can not be null"; |
3435 |
|
3440 |
|
3436 |
//CharSequence unitName = PersistentUtils.readUTF(aStream, DefaultCache.getManager()); |
3441 |
//CharSequence unitName = PersistentUtils.readUTF(aStream, DefaultCache.getManager()); |
Lines 3464-3470
Link Here
|
3464 |
|
3469 |
|
3465 |
includedFileContainer = new IncludedFileContainer(this, aStream); |
3470 |
includedFileContainer = new IncludedFileContainer(this, aStream); |
3466 |
|
3471 |
|
3467 |
uniqueName = PersistentUtils.readUTF(aStream, ProjectNameCache.getManager()); |
3472 |
uniqueName = APTSerializeUtils.readFileNameIndex(aStream, ProjectNameCache.getManager(), unitId); |
3468 |
assert uniqueName != null : "uniqueName can not be null"; |
3473 |
assert uniqueName != null : "uniqueName can not be null"; |
3469 |
|
3474 |
|
3470 |
this.model = (ModelImpl) CsmModelAccessor.getModel(); |
3475 |
this.model = (ModelImpl) CsmModelAccessor.getModel(); |
Lines 3473-3478
Link Here
|
3473 |
this.hasFileSystemProblems = aStream.readBoolean(); |
3478 |
this.hasFileSystemProblems = aStream.readBoolean(); |
3474 |
} |
3479 |
} |
3475 |
|
3480 |
|
|
|
3481 |
protected int getUnitId() { |
3482 |
return unitId; |
3483 |
} |
3484 |
|
3476 |
private final WeakContainer<DeclarationContainerProject> weakDeclarationContainer; |
3485 |
private final WeakContainer<DeclarationContainerProject> weakDeclarationContainer; |
3477 |
private DeclarationContainerProject getDeclarationsSorage() { |
3486 |
private DeclarationContainerProject getDeclarationsSorage() { |
3478 |
DeclarationContainerProject dc = weakDeclarationContainer.getContainer(); |
3487 |
DeclarationContainerProject dc = weakDeclarationContainer.getContainer(); |