Use enhanced switch expressions where feasible

Closes gh-28014
This commit is contained in:
a.yazychyan
2022-02-07 20:51:32 +03:00
committed by Sam Brannen
parent 42d114534b
commit c5c926726d
38 changed files with 291 additions and 493 deletions

View File

@@ -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));
}
}