File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
hibernate-core/src/main/java/org/hibernate/engine/config/spi Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change 66
77
88
9+ import static java .lang .Boolean .parseBoolean ;
10+ import static java .lang .Integer .parseInt ;
911import static org .hibernate .engine .config .spi .ConfigurationService .Converter ;
1012
1113/**
@@ -17,9 +19,9 @@ public class StandardConverters {
1719 public static final Converter <Boolean > BOOLEAN = StandardConverters ::asBoolean ;
1820
1921 public static Boolean asBoolean (Object value ) {
20- return value instanceof Boolean
21- ? ( Boolean ) value
22- : Boolean . parseBoolean ( value .toString () );
22+ return value instanceof Boolean bool
23+ ? bool
24+ : parseBoolean ( value .toString () );
2325 }
2426
2527 public static final Converter <String > STRING = StandardConverters ::asString ;
@@ -31,11 +33,9 @@ public static String asString(Object value) {
3133 public static final Converter <Integer > INTEGER = StandardConverters ::asInteger ;
3234
3335 public static Integer asInteger (Object value ) {
34- if ( value instanceof Number ) {
35- return ( (Number ) value ).intValue ();
36- }
37-
38- return Integer .parseInt ( value .toString () );
36+ return value instanceof Number number
37+ ? number .intValue ()
38+ : parseInt ( value .toString () );
3939 }
4040
4141 /**
You can’t perform that action at this time.
0 commit comments