#1059 - Cleanup the core codebase.

Clean up code containing various patterns:

* Remove redundant `final`, `public`, and `static` declarations in interfaces and enums.
* Replace redundant `? extends Object` generic parameters with `?`.
* Convert collections to arrays using empty array instead of pre-sized one (modern JVM recommendation).
* Initialize collections using constructor call over `addAll`.
* Favor `addAll` over iterating and adding one-by-one.
* Take advantage of `Map.forEach` that was introduced with Java 8.
This commit is contained in:
Greg Turnquist
2019-08-30 15:32:13 -05:00
parent 9d83787a54
commit fff5396a1c
24 changed files with 94 additions and 103 deletions

View File

@@ -126,7 +126,7 @@ public class Traverson {
return DEFAULTS.getHttpMessageConverters(Arrays.asList(mediaTypes));
}
private static final RestOperations createDefaultTemplate(List<MediaType> mediaTypes) {
private static RestOperations createDefaultTemplate(List<MediaType> mediaTypes) {
RestTemplate template = new RestTemplate();
template.setMessageConverters(DEFAULTS.getHttpMessageConverters(mediaTypes));