#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:
@@ -202,8 +202,7 @@ public class Link implements Serializable {
|
||||
|
||||
Assert.notNull(affordance, "Affordance must not be null!");
|
||||
|
||||
List<Affordance> newAffordances = new ArrayList<>();
|
||||
newAffordances.addAll(this.affordances);
|
||||
List<Affordance> newAffordances = new ArrayList<>(this.affordances);
|
||||
newAffordances.add(affordance);
|
||||
|
||||
return withAffordances(newAffordances);
|
||||
@@ -281,7 +280,7 @@ public class Link implements Serializable {
|
||||
* @param arguments must not be {@literal null}.
|
||||
* @return
|
||||
*/
|
||||
public Link expand(Map<String, ? extends Object> arguments) {
|
||||
public Link expand(Map<String, ?> arguments) {
|
||||
return new Link(template.expand(arguments).toString(), getRel());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user