Skip to content

Commit

Permalink
Sonar cloud issue fix
Browse files Browse the repository at this point in the history
  • Loading branch information
fugerit79 committed Sep 15, 2023
1 parent 6ec8fb6 commit 371999f
Showing 1 changed file with 22 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
import javax.xml.transform.dom.DOMSource;

import org.fugerit.java.core.cfg.ConfigException;
import org.fugerit.java.core.cfg.ConfigRuntimeException;
import org.fugerit.java.core.cfg.helpers.AbstractConfigurableObject;
import org.fugerit.java.core.cfg.helpers.XMLConfigurableObject;
import org.fugerit.java.core.cfg.provider.ConfigProviderFacade;
import org.fugerit.java.core.function.SafeFunction;
import org.fugerit.java.core.io.helper.StreamHelper;
import org.fugerit.java.core.lang.helpers.BooleanUtils;
import org.fugerit.java.core.lang.helpers.ClassHelper;
Expand Down Expand Up @@ -268,11 +270,26 @@ public GenericListCatalogConfig( String attTagDataList, String attTagData ) {

private Set<String> entryIdCheck;

public static <T> GenericListCatalogConfig<T> load( InputStream is, GenericListCatalogConfig<T> config ) throws Exception {
Document doc = DOMIO.loadDOMDoc( is, true );
Element root = doc.getDocumentElement();
config.configure( root );
return config;
/**
* <p>Configure an instance of GenericListCatalogConfig</p>
*
* <p>NOTE: starting in version 8.4.X java.lang.Exception removed in favor of org.fugerit.java.core.cfg.ConfigRuntimeException.
* ({@link https://gist.github.com/fugerit79/fdd401c6d457b57ba4a6b72ae998c385} </p>
*
* @param <T> the type of the elements in catalog
* @param is the input stream to load from
* @param config the instance to be configured
* @return the configured instance
* @throws ConfigRuntimeException in case of issues during loading
*/
public static <T> GenericListCatalogConfig<T> load( InputStream is, GenericListCatalogConfig<T> config ) {
return SafeFunction.get( () -> {
Document doc = DOMIO.loadDOMDoc( is, true );
Element root = doc.getDocumentElement();
config.configure( root );
return config;
} );

}

protected Set<String> getEntryIdCheck() {
Expand Down

0 comments on commit 371999f

Please sign in to comment.