Fix JavaDoc of synchronization requirements of updateScoresWithoutCommit():
- We use the IdentityFetcher so the caller must synchronize on it
- We use the WOT so the caller must synchronize on it
- The function does not need to be synchronized since the caller has to take care of locking the WOT anyway: He has to to preserve locking order between WOT and IdentityFetcher. And the caller will always do other stuff to the WOT before using this function (changing of trust values) so he has to synchronize on the WOT anyway
- This is related to https://bugs.freenetproject.org/view.php?id=5880
- The following commits on this branch will take care of fixing all callers of this function.
Fix synchronization of removeTrustWithoutCommit(Trust trust):
- This is a caller of updateScoresWithoutCommit() whose changes induced this branch. Therefore it has to constrain to its synchronization requirements
- Synchronizing on the WOT doesn't make any sense here as well as the caller will have to do different stuff on the WOT and synchronize on it anyway.
- The following commits on this branch will take care of fixing all callers of this function.
Fix synchronization in deleteDuplicateObjects():
- This is a caller of removeTrustWithoutCommit(Trust trust). Therefore it has to constrain to its synchronization requirements
Fix synchronization of removeTrustWithoutCommit(OwnIdentity truster, Identity trustee):
- This is a caller of removeTrustWithoutCommit(Trust trust). Therefore it has to constrain to its synchronization requirements
- Synchronizing on the WOT doesn't make any sense here as well as the caller will have to do different stuff on the WOT and synchronize on it anyway.
- The following commits will deal with its callers
Indent.
Fix synchronization of removeTrust(OwnIdentity truster, Identity trustee):
- This is a caller of removeTrustWithoutCommit(OwnIdentity truster, Identity trustee). Therefore it has to constrain to its synchronization requirements
- The following commits will deal with its callers
Fix dangerous synchronization of removeTrust(OwnIdentity truster, Identity trustee) by inlining it into its only caller:
- The function did not have any synchronization requirements documented and did seem to be fully synchronized. However, if the OwnIdentity/Identity parameter objects were deleted between their obtaining and the calling of the function, it would lead to them being accidentally stored in the database again.
Fix synchronization requirements of setTrustWithoutCommit(Identity truster, Identity trustee, byte newValue, String newComment):
- This is a caller of updateScoresWithoutCommit() whose changes induced this branch. Therefore it has to constrain to its synchronization requirements
- The following commits will take care of fixing all callers of this function.
Fix synchronization of createOwnIdentity(FreenetURI insertURI, String nickName, boolean publishTrustList, String context):
- This is a caller of setTrustWithoutCommit(). Therefore it has to constrain to its synchronization requirements
Fix synchronization of setTrust(OwnIdentity truster, Identity trustee, byte newValue, String newComment):
- This is a caller of setTrustWithoutCommit(). Therefore it has to constrain to its synchronization requirements
- The callers need to synchronize on the WebOfTrust anyway because of the Identity objects so there is no sense to synchronize on it in this function