common/src/main/java/org/jboss/pnc/common/Configuration.java
@SuppressWarnings("unchecked")
    public <T extends AbstractModuleConfig> T getModuleConfig(ConfigProvider<T> provider) throws ConfigurationParseException {
        Class<T> moduleClass = provider.getType();
        if(configCache.containsKey(moduleClass))
            return (T) configCache.get(moduleClass);
        
        synchronized(this) {
            if(configCache.containsKey(moduleClass)) {
                return (T) configCache.get(moduleClass);
            }

            T config = configurationJsonParser.parseJSONPNCConfig(CONFIG_STRING,  provider);
            configCache.put(moduleClass, config);
            return config;
        }
    }
@SuppressWarnings("unchecked")
    public <T extends AbstractModuleConfig> T getModuleConfig(ConfigProvider<T> provider) throws ConfigurationParseException {
        Class<T> moduleClass = provider.getType();
        if(configCache.containsKey(moduleClass))
            return (T) configCache.get(moduleClass);
        
        synchronized(this) {
            if(configCache.containsKey(moduleClass)) {
                return (T) configCache.get(moduleClass);
            }

            T config = configurationJsonParser.parseJSONPNCConfig(CONFIG_STRING,  provider);
            configCache.put(moduleClass, config);
            return config;
        }
    }
@ SuppressWarnings ( "unchecked" ) public < T extends AbstractModuleConfig > T getModuleConfig ( ConfigProvider < T > provider ) throws ConfigurationParseException { Class < T > moduleClass = provider . getType ( ) ; if ( configCache . containsKey ( moduleClass ) ) return ( T ) configCache . get ( moduleClass ) ; synchronized ( this ) { if ( configCache . containsKey ( moduleClass ) ) { return ( T ) configCache . get ( moduleClass ) ; } T config = configurationJsonParser . parseJSONPNCConfig ( CONFIG_STRING , provider ) ; configCache . put ( moduleClass , config ) ; return config ; } }
Reads configuration for module

@param provider configuration provider of given module config type
@param <T> module config
@return Loaded configuration
@throws ConfigurationParseException Thrown if configuration file couldn't be loaded or parsed
Reads configuration for module