-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
a:new-ruleProposal to add a new built-in ruleProposal to add a new built-in rule
Milestone
Description
Double brace initialisation is a pattern to initialise eg collections concisely. But it implicitly generates a new .class
file, and the object holds a strong reference to the enclosing object...
Example:
new ArrayList<String>() {{ addAll("a", "b", "c"); }};
I think, we could detect that for collections as a first step. But any instance initialiser in an anonymous class that calls only public methods of the object could be considered an instance of this code smell, if no methods are overridden.
jsotuyod and adangel
Metadata
Metadata
Assignees
Labels
a:new-ruleProposal to add a new built-in ruleProposal to add a new built-in rule