private MappedClass addMappedClass ( final MappedClass mc , final boolean validate ) { addConverters ( mc ) ; if ( validate && ! mc . isInterface ( ) ) { mc . validate ( this ) ; } mappedClasses . put ( mc . getClazz ( ) . getName ( ) , mc ) ; Set < MappedClass > mcs = mappedClassesByCollection . get ( mc . getCollectionName ( ) ) ; if ( mcs == null ) { mcs = new CopyOnWriteArraySet < MappedClass > ( ) ; final Set < MappedClass > temp = mappedClassesByCollection . putIfAbsent ( mc . getCollectionName ( ) , mcs ) ; if ( temp != null ) { mcs = temp ; } } mcs . add ( mc ) ; return mc ; }
Add MappedClass to internal cache possibly validating first .