| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Reports on declarations of Collection variables made by using the collection class as the type, rather than an appropriate interface.
Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
|
|
|
|
|
|
| |
Reports Collection.addAll() and Map.putAll() calls after instantiation of a collection using a constructor call without arguments. Such constructs can be replaced with a single call to a parametrized constructor which simplifies code. Also for some collections the replacement might be more performant.
Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
|
|
|
|
|
|
|
| |
There are two styles to convert a collection to an array: either using a pre-sized array (like c.toArray(new String[c.size()])) or using an empty array (like c.toArray(new String[0]).
In older Java versions using pre-sized array was recommended, as the reflection call which is necessary to create an array of proper size was quite slow. However since late updates of OpenJDK 6 this call was intrinsified, making the performance of the empty array version the same and sometimes even better, compared to the pre-sized version. Also passing pre-sized array is dangerous for a concurrent or synchronized collection as a data race is possible between the size and toArray call which may result in extra nulls at the end of the array, if the collection was concurrently shrunk during the operation.
Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
|
|
|
|
|
|
| |
Reports common usage patterns of java.util.Map that could be replaced with Java 8 methods: getOrDefault(), computeIfAbsent(), putIfAbsent(), merge(), or replaceAll().
Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
|
|
|
|
|
|
| |
Reports the manual copying of array contents which may be replaced by calls to System.arraycopy().
Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
|
|
|
|
|
|
| |
Reports calls to Collections.sort(list, comparator) which could be replaced with list.sort(comparator).
Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
|
|
|
|
| |
Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
|
|
|
|
|
|
| |
Reports the copying of array contents to a collection where each element is added individually using a for loop. Such constructs may be replaced by a call to Collection.addAll(Arrays.asList()) or Collections.addAll().
Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
|
| |
|
| |
|
| |
|
|\
| |
| | |
Remove checks for old Java Versions
|
| |\
| |/
|/|
| | |
remove-old-version-checks
|
| | |
|
| |\
| |/
|/|
| | |
remove-old-version-checks
|
|\ \
| | |
| | | |
Fix and improve the CI Jobs
|
| |\ \
| |/ /
|/| |
| | |
| | |
| | | |
feature/github-actions
Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
|
| | | |
|
| | | |
|
| | | |
|
| |\ \
| | | |
| | | |
| | | |
| | | |
| | | | |
into feature/github-actions
Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
|
| |/ /
|/| |
| | |
| | |
| | |
| | | |
`com.sun.tools.javadoc.Main` isn't available in recent Java versions (13+)
Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
|
| | | |
|
| | |
| | |
| | |
| | | |
Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
|
| | |
| | |
| | |
| | | |
Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
|
| | |
| | |
| | |
| | | |
Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
|
| | |
| | |
| | |
| | | |
Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
|
| | |
| | |
| | |
| | | |
Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
|
| | |
| | |
| | |
| | | |
Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
|
| |/
|/|
| |
| | |
Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
|
|/ |
|
|\
| |
| | |
Create a simple CI Job using GitHub Actions
|
| |
| |
| |
| | |
Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
|
| |
| |
| |
| | |
Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
|
| |
| |
| |
| | |
Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
|
|\ \
| |/
|/| |
Use the diamond operator where possible
|
|/
|
|
| |
Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
|
|\
| |
| | |
Update the code to Java 5 features
|
| |\
| |/
|/| |
|
| | |
|
| |
| |
| |
| |
| |
| | |
Reports "unboxing", e.g. explicit unwrapping of wrapped primitive values. Unboxing is unnecessary under Java 5 and newer, and can be safely removed.
Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
|
| |
| |
| |
| |
| |
| | |
Reports explicit boxing, i.e. wrapping of primitive values in objects. Explicit manual boxing is unnecessary under Java 5 and newer, and can be safely removed.
Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
|
| |
| |
| |
| |
| |
| | |
Reports any String.indexOf() expressions which can be replaced with a call to the String.contains() method available in Java 5 and newer.
Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
|
| |
| |
| |
| |
| |
| | |
Reports while loops which iterate over collections, and can be replaced with an enhanced for loop (i.e. foreach iteration syntax).
Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
|
|/
|
|
|
|
| |
Reports for loops which iterate over collections or arrays, and can be replaced with an enhanced for loop (i.e. the foreach iteration syntax).
Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
|
| |
|
|
|
|
|
|
| |
Move initialization of static final serialVersionUID field to clinit, since as of java9+, the runtime won't allow setting final fields outside clinit
Signed-off-by: Eli Finkel <eyfinkel@gmail.com>
|
| |
|
| |
|
| |
|