Details
Description
the following code snippet generate a NPE:
import java.util.ArrayList; import java.util.function.Function; public enum SonarProblemCase { MY_BUCKET(rp -> { return new ArrayList<Integer>(); }), // crashes MY_BUCKET2(rp -> new ArrayList<Integer>() ); // works fine SonarProblemCase(Function<Object,Object> bucketer) { } }
Attachments
Issue Links
- relates to
-
RSPEC-2293 The diamond operator ("<>") should be used
- Active
- links to