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() {
9898
9999 @ Override
100100 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 ;
104111 }
112+ }
105113
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 ;
110118 }
111119
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 ;
114124 }
115125
116- if (result != null ) {
117- propertyTypesByName . put ( propertyPath , result );
126+ if ( "id" . equals ( propertyPath ) ) {
127+ return identifierType ( );
118128 }
119- return result ;
129+
130+ return null ;
120131 }
121132
122133 abstract Type createPropertyType (String propertyPath );
You can’t perform that action at this time.
0 commit comments