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 6
6
7
7
8
8
9
+ import static java .lang .Boolean .parseBoolean ;
10
+ import static java .lang .Integer .parseInt ;
9
11
import static org .hibernate .engine .config .spi .ConfigurationService .Converter ;
10
12
11
13
/**
@@ -17,9 +19,9 @@ public class StandardConverters {
17
19
public static final Converter <Boolean > BOOLEAN = StandardConverters ::asBoolean ;
18
20
19
21
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 () );
23
25
}
24
26
25
27
public static final Converter <String > STRING = StandardConverters ::asString ;
@@ -31,11 +33,9 @@ public static String asString(Object value) {
31
33
public static final Converter <Integer > INTEGER = StandardConverters ::asInteger ;
32
34
33
35
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 () );
39
39
}
40
40
41
41
/**
You can’t perform that action at this time.
0 commit comments