BIMserver icon indicating copy to clipboard operation
BIMserver copied to clipboard

Strange behaviour of get method in ClientIfcModel

Open dkurillo opened this issue 3 years ago • 0 comments

Maybe I am missing something but ClientIfcModel.get(long oid) and ClientIfcModel.loadExplicit(long oid) have very strange behaviour.

Method "get" does the following:

IdEObject idEObject = super.get(oid); if (idEObject == null) { loadExplicit(oid); return super.get(oid); } return idEObject;

So if object is not found in BiMap cache it should be loaded explicitly

Then let's check "loadExplicit" method:

try { IdEObjectImpl idEObjectImpl = (IdEObjectImpl)super.get(oid); if (idEObjectImpl != null && !idEObjectImpl.isLoadedOrLoading() && !this.assumeCompletePreload) { .... }

It tries to get the same object from the same cache and if it is not found it won't load it explicitly and return null. So there will be null in return in anyway

dkurillo avatar Nov 09 '21 13:11 dkurillo