effective-java-3e-source-code icon indicating copy to clipboard operation
effective-java-3e-source-code copied to clipboard

[Item 81] Race condition in Intern.java

Open drnow4u opened this issue 4 years ago • 0 comments

Dear Joshua,

In example class Intern and method intern is race condition between line 18 and 19. It can also lead to memory leak.

https://github.com/jbloch/effective-java-3e-source-code/blob/bdc828a7af2bdfac28e3c38bd7d1a2ae05736ccc/src/effectivejava/chapter11/item81/Intern.java#L19

Kindly regards, Marcin

PS Thank you for your book. I'm continuously learning new things from it.

drnow4u avatar Nov 09 '20 21:11 drnow4u