All Downloads are FREE. Search and download functionalities are using the official Maven repository.

sorald.processor.CollectionsEmptyConstantsProcessor.md Maven / Gradle / Ivy

Go to download

An automatic repair system for static code analysis warnings from Sonar Java.

There is a newer version: 0.8.6
Show newest version
The `EMPTY_...` fields from `Collections` return raw types, so they are replaced by the `empty...()` methods that return generic ones.

Example:
```diff
- List collection1 = Collections.EMPTY_LIST;  // Noncompliant
- Map collection2 = Collections.EMPTY_MAP;  // Noncompliant
- Set collection3 = Collections.EMPTY_SET;  // Noncompliant
+ List collection1 = Collections.emptyList();
+ Map collection2 = Collections.emptyMap();
+ Set collection3 = Collections.emptySet();
```




© 2015 - 2025 Weber Informatics LLC | Privacy Policy