The allDrugs map is static but the methods of DrugController are not. Making its methods synchronised still allows simultaneous access to the allDrugs via 2 different DrugController objects. Either the methods should be static too or or
synchronized(DrugController.class)
should be used.
Morteza Jalalvand
Level 31
possible bug in the correct solution
New
Comments
- Popular
- New
- Old
You must be signed in to leave a comment
This page doesn't have any comments yet