mirror of
https://github.com/jlengrand/error-prone-support.git
synced 2026-03-10 08:11:25 +00:00
1.0 KiB
1.0 KiB
layout, title, parent, nav_order
| layout | title | parent | nav_order |
|---|---|---|---|
| default | CollectorMutability | Bug Patterns | 1 |
CollectorMutability
FragileCode
${EXTRA_DOCS}
Samples
```java public static void sample() {} ```
View source code on GitHubCollectorMutability
Avoid `Collectors.to{List,Map,Set}` in favour of alternatives that emphasize (im)mutability
| Severity | WARNING |
| Tags | FragileCode |
Suppression
Suppress false positives by adding the suppression annotation @SuppressWarnings("CollectorMutability") to the enclosing element.