mirror of
https://github.com/usatiuk/dhfs.git
synced 2025-10-28 20:47:49 +01:00
fixie
This commit is contained in:
@@ -149,9 +149,11 @@ public class JObject<T extends JObjectData> implements Serializable, Comparable<
|
||||
assertRWLock();
|
||||
if (_dataPart.get() != null)
|
||||
throw new IllegalStateException("Data is not null when recording external resolution of " + getName());
|
||||
if (!data.pushResolution())
|
||||
throw new IllegalStateException("Expected external resolution only for classes with pushResolution " + getName());
|
||||
_metaPart.narrowClass(data.getClass());
|
||||
_dataPart.set(data);
|
||||
if (!_metaPart.isLocked() && _metaPart.getRefcount() == 0)
|
||||
if (!_metaPart.isLocked())
|
||||
_metaPart.lock();
|
||||
hydrateRefs();
|
||||
verifyRefs();
|
||||
|
||||
@@ -145,16 +145,18 @@ public class JObjectManagerImpl implements JObjectManager {
|
||||
}
|
||||
JObject<D> finalRet = (JObject<D>) ret;
|
||||
ret.runWriteLocked(JObject.ResolutionStrategy.NO_RESOLUTION, (m, d, b, i) -> {
|
||||
if (parent.isPresent()) {
|
||||
m.addRef(parent.get());
|
||||
} else {
|
||||
m.lock();
|
||||
}
|
||||
|
||||
if (object.pushResolution() && object.assumeUnique() && finalRet.getData() == null) {
|
||||
finalRet.externalResolution(object);
|
||||
}
|
||||
|
||||
if (parent.isPresent()) {
|
||||
m.addRef(parent.get());
|
||||
if (m.isLocked())
|
||||
m.unlock();
|
||||
} else {
|
||||
m.lock();
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
return (JObject<D>) ret;
|
||||
|
||||
Reference in New Issue
Block a user