protected <S extends PropertySource<?>>List<S> findPropertySources(Class<S> sourceClass){
  List<S> managedSources=new LinkedList<>();
  LinkedList<PropertySource<?>> sources=toLinkedList(environment.getPropertySources());
  while (!sources.isEmpty()) {
    PropertySource<?> source=sources.pop();
    if (source instanceof CompositePropertySource) {
      CompositePropertySource comp=(CompositePropertySource)source;
      sources.addAll(comp.getPropertySources());
    }
 else     if (sourceClass.isInstance(source)) {
      managedSources.add(sourceClass.cast(source));
    }
  }
  return managedSources;
}

protected < S extends PropertySource < ? > > List < S > findPropertySources ( Class < S > sourceClass ) { List < S > managedSources = new LinkedList < > ( ) ; LinkedList < PropertySource < ? > > sources = toLinkedList ( environment . getPropertySources ( ) ) ; while ( ! sources . isEmpty ( ) ) { PropertySource < ? > source = sources . pop ( ) ; if ( source instanceof CompositePropertySource ) { CompositePropertySource comp = ( CompositePropertySource ) source ; sources . addAll ( comp . getPropertySources ( ) ) ; } else if ( sourceClass . isInstance ( source ) ) { managedSources . add ( sourceClass . cast ( source ) ) ; } } return managedSources ; }
finds all registered property sources of the given type .
