public T createInstance() {
        Ini ini = resolveIni();

        T instance;

        if (CollectionUtils.isEmpty(ini)) {
            LOGGER.debug("No populated Ini available.  Creating a default instance.");
            instance = createDefaultInstance();
            if (instance == null) {
                String msg = getClass().getName() + " implementation did not return a default instance in "
                        + "the event of a null/empty Ini configuration.  This is required to support the "
                        + "Factory interface.  Please check your implementation.";
                throw new IllegalStateException(msg);
            }
        } else {
            LOGGER.debug("Creating instance from Ini [" + ini + "]");
            instance = createInstance(ini);
            if (instance == null) {
                String msg = getClass().getName() + " implementation did not return a constructed instance from "
                        + "the createInstance(Ini) method implementation.";
                throw new IllegalStateException(msg);
            }
        }

        return instance;
    }
Creates a new object instance by using a configured INI source.  This implementation functions as follows:
<ol>
<li>{@link #resolveIni() Resolve} the {@code Ini} source to use for configuration.</li>
<li>If there was no resolved Ini source, create and return a simple default instance via the
{@link #createDefaultInstance()} method.</li>
</ol>

@return a new {@code SecurityManager} instance by using a configured INI source.
core/src/main/java/org/apache/shiro/ini/IniFactorySupport.java