Open mistriel opened 3 months ago
true. the issue is putUnique could be called elsewhere, so the question is how to determine where to stop? private? protected, package private??? etc. what if another method in this class called putUnique? What if a chain of 5 methods in this class called putUnique, and the last one was public? I'm not arguing you are correct, just that it's kind of untractable.
We could say a private method that is only called from a static block is ok. That's probably doable.
Hi,
So lets agree on the final statement, with addition to constructor as well.
WDYT ?
sure, assuming the field is an instance field
my case has two issues related to this check,
In the following scenario if
putUnique
was public there were an option to bloat the Map, yet sinceputUnique
is private androleMapping
is private thenroleMapping
field is immutable.