Use enhanced switch expressions where feasible
Closes gh-28014
This commit is contained in:
@@ -61,18 +61,14 @@ public class AbstractPropertyAccessorBenchmark {
|
||||
this.propertyAccessor = new BeanWrapperImpl(this.target);
|
||||
}
|
||||
switch (this.customEditor) {
|
||||
case "stringTrimmer":
|
||||
this.propertyAccessor.registerCustomEditor(String.class, new StringTrimmerEditor(false));
|
||||
break;
|
||||
case "numberOnPath":
|
||||
this.propertyAccessor.registerCustomEditor(int.class, "array.somePath", new CustomNumberEditor(Integer.class, false));
|
||||
break;
|
||||
case "numberOnNestedPath":
|
||||
this.propertyAccessor.registerCustomEditor(int.class, "array[0].somePath", new CustomNumberEditor(Integer.class, false));
|
||||
break;
|
||||
case "numberOnType":
|
||||
this.propertyAccessor.registerCustomEditor(int.class, new CustomNumberEditor(Integer.class, false));
|
||||
break;
|
||||
case "stringTrimmer" -> this.propertyAccessor.registerCustomEditor(String.class,
|
||||
new StringTrimmerEditor(false));
|
||||
case "numberOnPath" -> this.propertyAccessor.registerCustomEditor(int.class, "array.somePath",
|
||||
new CustomNumberEditor(Integer.class, false));
|
||||
case "numberOnNestedPath" -> this.propertyAccessor.registerCustomEditor(int.class, "array[0].somePath",
|
||||
new CustomNumberEditor(Integer.class, false));
|
||||
case "numberOnType" -> this.propertyAccessor.registerCustomEditor(int.class,
|
||||
new CustomNumberEditor(Integer.class, false));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user