8
8
import java .util .Locale ;
9
9
import java .util .Map ;
10
10
11
- import org .hibernate .internal .util .StringHelper ;
12
11
import org .hibernate .type .descriptor .java .BasicJavaType ;
13
12
14
13
import org .jboss .logging .Logger ;
15
14
15
+ import static org .hibernate .internal .util .StringHelper .isEmpty ;
16
+
16
17
/**
17
18
* Basic implementation of {@link TypeDefinitionRegistry}.
18
19
*
@@ -38,24 +39,20 @@ public TypeDefinition resolve(String typeName) {
38
39
if ( localDefinition != null ) {
39
40
return localDefinition ;
40
41
}
41
-
42
- if ( parent != null ) {
42
+ else if ( parent != null ) {
43
43
return parent .resolve ( typeName );
44
44
}
45
-
46
- return null ;
45
+ else {
46
+ return null ;
47
+ }
47
48
}
48
49
49
50
@ Override
50
51
public TypeDefinition resolveAutoApplied (BasicJavaType <?> jtd ) {
51
- // For now, check the definition map for a entry keyed by the JTD name.
52
- // Ultimately should maybe have TypeDefinition or the registry keep explicit track of
53
- // auto-applied defs
54
- if ( jtd .getJavaType () == null ) {
55
- return null ;
56
- }
57
-
58
- return typeDefinitionMap .get ( jtd .getTypeName () );
52
+ // For now, check the definition map for an entry keyed by the JTD name.
53
+ // Ultimately should maybe have TypeDefinition or the registry keep explicit
54
+ // track of auto-applied definitions.
55
+ return jtd .getJavaType () == null ? null : typeDefinitionMap .get ( jtd .getTypeName () );
59
56
}
60
57
61
58
@ Override
@@ -73,7 +70,7 @@ public TypeDefinitionRegistry register(TypeDefinition typeDefinition, Duplicatio
73
70
throw new IllegalArgumentException ( "TypeDefinition to register cannot define null #typeImplementorClass" );
74
71
}
75
72
76
- if ( !StringHelper . isEmpty ( typeDefinition .getName () ) ) {
73
+ if ( !isEmpty ( typeDefinition .getName () ) ) {
77
74
register ( typeDefinition .getName (), typeDefinition , duplicationStrategy );
78
75
}
79
76
0 commit comments