Fix race condition that allowed Component.getType() to return null (#4700)

This fix prevents an NPE in org.hibernate.mapping.SimpleValue.isValid() and likely elsewhere
This commit is contained in:
Craig K 2022-01-26 08:18:01 -06:00 committed by GitHub
parent cc0b198142
commit 751aa6f50f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -196,7 +196,8 @@ public class Component extends SimpleValue implements MetaAttributable, Sortable
if ( localType == null ) {
synchronized ( this ) {
if ( type == null ) {
localType = type;
if ( localType == null ) {
// Make sure this is sorted which is important especially for synthetic components
// Other components should be sorted already
sortProperties( true );