@ SuppressWarnings ( "unchecked" ) private < T extends ItemInfoImpl > T getOrCreateInfo ( final ConfigItem type , final Object item ) { final Class < ? > itemType = getType ( item ) ; final T info ; // details holder allows to implicitly filter by type and avoid duplicate registration if ( detailsHolder . containsKey ( itemType ) ) { // no duplicate registration info = ( T ) detailsHolder . get ( itemType ) ; } else { itemsHolder . put ( type , item ) ; info = type . newContainer ( itemType ) ; detailsHolder . put ( itemType , info ) ; } return info ; }
Disabled items may not be actually registered . In order to register disable info in uniform way dummy container is created .