Skip to content

Update ProductsDatabase.java - #3

Open
smagill wants to merge 1 commit into
masterfrom
smagill-patch-2
Open

smagill wants to merge 1 commit into
masterfrom
smagill-patch-2

Conversation

@smagill

@smagill smagill commented Sep 14, 2020

Copy link
Copy Markdown
Owner

No description provided.

@@ -26,6 +26,7 @@ public Product findById(String id) {
return products.get(id);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

THREAD_SAFETY_VIOLATION: Read/Write race. Non-private method ProductsDatabase.findById(...) reads without synchronization from container this.products via call to Map.get(...). Potentially races with write in method ProductsDatabase.add(...).
Reporting because another access to the same memory occurs on a background thread, although this access may not.

@@ -26,6 +26,7 @@ public Product findById(String id) {
return products.get(id);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

THREAD_SAFETY_VIOLATION: Read/Write race. Non-private method ProductsDatabase.findById(...) reads without synchronization from container this.products via call to Map.get(...). Potentially races with write in method ProductsDatabase.add(...).
Reporting because another access to the same memory occurs on a background thread, although this access may not.

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.

1 participant