Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AbstractAccessReferenceMap Issues #37 #329 #469

Merged
merged 6 commits into from Jan 16, 2019

Conversation

jeremiahjstacey
Copy link
Collaborator

Potential resolutions for two issues in AbstractAccessReferenceMap.

First, handling #329 I've provided a multi-threaded unit test which replicates the condition consistently. The offered solution is to add synchronized keyword to all public API of the AbstractAccessReferenceMap.

Second, #37 Provided a test which shows that in cases where subclasses return the same indirect key multiple times it can lead to corruption during update. Logic updates were made to the implementation to address.

SThis test case consistently illustrates the race condition resulting from
concurrent invocations of addDirectReference.
Synchronizing all public access methods to this wrapper class.
Updating class documentation to provide an example of multi-interaction
synchronization syntax.
With primary synchronization being pushed to the class API level, there
really is no benefit to maintaining the overhead of ConcurrentHashMap
fields.  The thread-safety guaranteed by the ConcurrentHashMap is
superceeded by the public API of the abstract class, and should never
actually be leveraged.

This assumes that all sub-classes with extended public API continue the
use of class-level synchronization.
Adding method which shows that it is possible to create a corrupted direct
-> Indirect to Indirect -> Direct Object relationship when using the
public update(Set) API.
Altering the logic of update behavior to avoid the possibility of the same
indirect object being associated with multiple direct instances.
@kwwall kwwall merged commit c34eeaa into ESAPI:develop Jan 16, 2019
@kwwall
Copy link
Contributor

kwwall commented Jan 16, 2019

Close issue #37
Close issue #329

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants