File tree Expand file tree Collapse file tree 1 file changed +23
-12
lines changed
tooling/metamodel-generator/src/main/java/org/hibernate/processor/validation Expand file tree Collapse file tree 1 file changed +23
-12
lines changed Original file line number Diff line number Diff line change @@ -98,25 +98,36 @@ public String getEntityName() {
98
98
99
99
@ Override
100
100
public final Type getPropertyType (String propertyPath ) {
101
- Type result = propertyTypesByName .get (propertyPath );
102
- if (result !=null ) {
103
- return result ;
101
+ final Type cached = propertyTypesByName .get (propertyPath );
102
+ if ( cached == null ) {
103
+ final Type type = propertyType ( propertyPath );
104
+ if ( type != null ) {
105
+ propertyTypesByName .put ( propertyPath , type );
106
+ }
107
+ return type ;
108
+ }
109
+ else {
110
+ return cached ;
104
111
}
112
+ }
105
113
106
- result = createPropertyType ( propertyPath );
107
- if ( result == null ) {
108
- //check subclasses, needed for treat()
109
- result = getSubclassPropertyType ( propertyPath ) ;
114
+ private Type propertyType ( String propertyPath ) {
115
+ final Type type = createPropertyType ( propertyPath );
116
+ if ( type != null ) {
117
+ return type ;
110
118
}
111
119
112
- if ("id" .equals ( propertyPath )) {
113
- result = identifierType ();
120
+ //check subclasses, needed for treat()
121
+ final Type typeFromSubclass = getSubclassPropertyType ( propertyPath );
122
+ if ( typeFromSubclass != null ) {
123
+ return typeFromSubclass ;
114
124
}
115
125
116
- if (result != null ) {
117
- propertyTypesByName . put ( propertyPath , result );
126
+ if ( "id" . equals ( propertyPath ) ) {
127
+ return identifierType ( );
118
128
}
119
- return result ;
129
+
130
+ return null ;
120
131
}
121
132
122
133
abstract Type createPropertyType (String propertyPath );
You can’t perform that action at this time.
0 commit comments