package org.pac4j.dropwizard;

import org.pac4j.core.config.Config;
import org.pac4j.core.config.ConfigSingleton;
import org.pac4j.jax.rs.features.Pac4JSecurityFeature;
import org.pac4j.jax.rs.features.Pac4JSecurityFilterFeature;
import org.pac4j.jax.rs.features.jersey.Pac4JValueFactoryProvider;
import org.pac4j.jax.rs.filter.SecurityFilter;

import io.dropwizard.Configuration;
import io.dropwizard.ConfiguredBundle;
import org.pac4j.dropwizard.Pac4jFactory.FilterConfiguration;
import io.dropwizard.setup.Bootstrap;
import io.dropwizard.setup.Environment;

/**
 * A {@link ConfiguredBundle} which installs a {@link SecurityFilter}
 * into a Dropwizard application's Jetty servlet handler chain.
 */
public abstract class Pac4jBundle<T extends Configuration>
    implements ConfiguredBundle<T>, Pac4jConfiguration<T>
{
    @Override
    public final void initialize(Bootstrap<?> bootstrap) { }

    @Override
    public final void run(T configuration, Environment environment) throws Exception {
        final Pac4jFactory pac4jFactory = getPac4jFactory(configuration);

        final Config config = ConfigSingleton.getConfig() == null ? new Config() : ConfigSingleton.getConfig();
        ConfigSingleton.setConfig(config);

        for (FilterConfiguration fConf : pac4jFactory.getFilters()) {
            environment.jersey().register(new Pac4JSecurityFilterFeature(config, fConf.getSkipResponse(),
                    fConf.getAuthorizers(), fConf.getClients(), fConf.getMatchers(), fConf.getMultiProfile()));
        }

        environment.jersey().register(new Pac4JSecurityFeature(config));
        environment.jersey().register(new Pac4JValueFactoryProvider.Binder(config));
    }
}

@@ -103,24 +103,86 @@
 gSingleton;%0A
+import org.pac4j.dropwizard.Pac4jFactory.FilterConfiguration;%0A
 import org.p
@@ -216,32 +216,32 @@
 ecurityFeature;%0A
-
 import org.pac4j
@@ -479,70 +479,8 @@
 le;%0A
-import org.pac4j.dropwizard.Pac4jFactory.FilterConfiguration;%0A
 impo
@@ -669,25 +669,17 @@
 s Je
-tty servlet handl
+rsey filt
 er c
@@ -813,32 +813,32 @@
 %7B%0A    @Override%0A
-
     public final
@@ -879,16 +879,45 @@
 strap) %7B
+%0A        // nothing to do%0A   
  %7D%0A%0A    

Fix class comments