/** * Retrieves the features from a participant, initializing them if necessary. * Do not set the initialized collection of features because features cannot be orphan * @param component the component * @return The returned features are ensured to be initialized * @since 2.4.0 */ public static Collection<Feature> ensureInitializedFeatures(Component component) { Collection<Feature> features; if (IntactCore.isInitialized(component.getFeatures())) { features = component.getFeatures(); } else { features = IntactContext.getCurrentInstance().getDaoFactory().getFeatureDao().getByComponentAc(component.getAc()); } return features; }
/** * Retrieves the features from a participant, initializing them if necessary. * Do not set the initialized collection of features because features cannot be orphan * @param component the component * @return The returned features are ensured to be initialized * @since 2.4.0 */ public static Collection<Feature> ensureInitializedFeatures(Component component) { Collection<Feature> features; if (IntactCore.isInitialized(component.getFeatures())) { features = component.getFeatures(); } else { features = IntactContext.getCurrentInstance().getDaoFactory().getFeatureDao().getByComponentAc(component.getAc()); } return features; }