@SuppressWarnings("unchecked") private void setupReferenceListAttribute(FactoryReferenceListAttribute<?, ?> referenceAttribute) { Class<?> referenceClass = referenceAttribute.internal_getReferenceClass(); Scope scope = factoryTreeBuilder.getScope(referenceClass); if (scope== Scope.SINGLETON) { referenceAttribute.userNotSelectable(); } // if (scope==Scope.PROTOTYPE) { // referenceAttribute.userNotSelectable(); // } FactoryReferenceListAttribute workaround = referenceAttribute; workaround.newValuesProvider(newValuesProvider); }