Dear Joshua,
In example class Intern and method intern is race condition between line 18 and 19. It can also lead to memory leak.
|
result = map.putIfAbsent(s, s); |
Kindly regards,
Marcin
PS
Thank you for your book. I'm continuously learning new things from it.
Dear Joshua,
In example class
Internand methodinternis race condition between line 18 and 19. It can also lead to memory leak.effective-java-3e-source-code/src/effectivejava/chapter11/item81/Intern.java
Line 19 in bdc828a
Kindly regards,
Marcin
PS
Thank you for your book. I'm continuously learning new things from it.