diff --git a/arquillian/resolver/src/main/java/org/wildfly/swarm/arquillian/resolver/ShrinkwrapArtifactResolvingHelper.java b/arquillian/resolver/src/main/java/org/wildfly/swarm/arquillian/resolver/ShrinkwrapArtifactResolvingHelper.java index 217fc71da6..ada54e3846 100644 --- a/arquillian/resolver/src/main/java/org/wildfly/swarm/arquillian/resolver/ShrinkwrapArtifactResolvingHelper.java +++ b/arquillian/resolver/src/main/java/org/wildfly/swarm/arquillian/resolver/ShrinkwrapArtifactResolvingHelper.java @@ -143,7 +143,7 @@ public ArtifactSpec resolve(ArtifactSpec spec) { @Override public Set resolveAll(final Collection specs, boolean transitive, boolean defaultExcludes) { if (specs.isEmpty()) { - return Collections.EMPTY_SET; + return Collections.emptySet(); } MavenResolutionStrategy transitivityStrategy = (transitive ? TransitiveStrategy.INSTANCE : NonTransitiveStrategy.INSTANCE); diff --git a/core/bootstrap/src/main/java/org/wildfly/swarm/bootstrap/env/FractionManifest.java b/core/bootstrap/src/main/java/org/wildfly/swarm/bootstrap/env/FractionManifest.java index 5e6c96252b..9141bcdddf 100644 --- a/core/bootstrap/src/main/java/org/wildfly/swarm/bootstrap/env/FractionManifest.java +++ b/core/bootstrap/src/main/java/org/wildfly/swarm/bootstrap/env/FractionManifest.java @@ -53,6 +53,7 @@ protected void read(URL url) throws IOException { } } + @SuppressWarnings("unchecked") protected void read(InputStream in) throws IOException { Yaml yaml = new Yaml(); Map data = (Map) yaml.load(in); diff --git a/core/bootstrap/src/main/java/org/wildfly/swarm/bootstrap/env/SystemDependencyResolution.java b/core/bootstrap/src/main/java/org/wildfly/swarm/bootstrap/env/SystemDependencyResolution.java index 0f2d0b7f76..6c8cd16cda 100644 --- a/core/bootstrap/src/main/java/org/wildfly/swarm/bootstrap/env/SystemDependencyResolution.java +++ b/core/bootstrap/src/main/java/org/wildfly/swarm/bootstrap/env/SystemDependencyResolution.java @@ -14,10 +14,10 @@ * @author Heiko Braun * @since 18/07/16 */ -public class SystemDependencyResolution implements DependencyResolution { +class SystemDependencyResolution implements DependencyResolution { - public SystemDependencyResolution() { + SystemDependencyResolution() { final String classpathProp = System.getProperty("java.class.path"); final String javaHomProp = System.getProperty("java.home"); final String userDirProp = System.getProperty("user.dir"); @@ -27,7 +27,7 @@ public SystemDependencyResolution() { this.useGradleRepo = classpathProp.contains(File.separator + ".gradle"); this.classpath = Arrays.asList(classpathProp.split(File.pathSeparator)); - this.testClasspath = testClasspatProp != null ? Arrays.asList(testClasspatProp.split(File.pathSeparator)) : Collections.EMPTY_LIST; + this.testClasspath = testClasspatProp != null ? Arrays.asList(testClasspatProp.split(File.pathSeparator)) : Collections.emptyList(); this.pwd = userDirProp; this.javaHome = javaHomProp.endsWith(JRE) ? javaHomProp.substring(0, javaHomProp.lastIndexOf(JRE)) : javaHomProp; @@ -44,7 +44,7 @@ public Set resolve(List exclusions) throws IOException { ApplicationEnvironment env = ApplicationEnvironment.get(); Set classpathElements = new HashSet<>(); Set providedGAVs = new HashSet<>(); - List testClasspathElements = testClasspath != null ? testClasspath : Collections.EMPTY_LIST; + List testClasspathElements = testClasspath != null ? testClasspath : Collections.emptyList(); for (final String element : classpath) { if (!element.startsWith(javaHome) && !element.startsWith(pwd + File.separatorChar) && !element.endsWith(".pom")) { @@ -80,17 +80,15 @@ public Set resolve(List exclusions) throws IOException { return archivesPaths; } - private static final String JAR = ".jar"; - private static final String JRE = "jre"; - final List classpath; + private final List classpath; - final String javaHome; + private final String javaHome; - final String pwd; + private final String pwd; - final List testClasspath; + private final List testClasspath; private final boolean useGradleRepo; diff --git a/core/bootstrap/src/main/java/org/wildfly/swarm/bootstrap/env/WildFlySwarmManifest.java b/core/bootstrap/src/main/java/org/wildfly/swarm/bootstrap/env/WildFlySwarmManifest.java index 37fff3181c..5633667e49 100644 --- a/core/bootstrap/src/main/java/org/wildfly/swarm/bootstrap/env/WildFlySwarmManifest.java +++ b/core/bootstrap/src/main/java/org/wildfly/swarm/bootstrap/env/WildFlySwarmManifest.java @@ -60,6 +60,7 @@ public void read(URL url) throws IOException { } } + @SuppressWarnings("unchecked") public void read(InputStream in) throws IOException { Yaml yaml = new Yaml(); Map data = (Map) yaml.load(in); @@ -98,7 +99,7 @@ public void write(Path path) throws IOException { @Override public String toString() { - Map data = new LinkedHashMap() {{ + Map data = new LinkedHashMap() {{ if (asset != null) { put(ASSET, asset); } @@ -119,7 +120,7 @@ public String toString() { return yaml.dump(data); } - protected void setupProperties() { + private void setupProperties() { // enumerate all properties, not just those with string // values, because Gradle (and others) can set non-string // values for things like swarm.http.port (integer) @@ -185,6 +186,7 @@ public void bundleDependencies(boolean bundleDependencies) { this.bundleDependencies = bundleDependencies; } + @SuppressWarnings("unused") public boolean isBundleDependencies() { if (this.bundleDependencies == null) { return true; diff --git a/core/bootstrap/src/main/java/org/wildfly/swarm/bootstrap/modules/GradleResolver.java b/core/bootstrap/src/main/java/org/wildfly/swarm/bootstrap/modules/GradleResolver.java index 8656acb39b..af15ce8a4c 100644 --- a/core/bootstrap/src/main/java/org/wildfly/swarm/bootstrap/modules/GradleResolver.java +++ b/core/bootstrap/src/main/java/org/wildfly/swarm/bootstrap/modules/GradleResolver.java @@ -43,7 +43,7 @@ */ public class GradleResolver implements MavenResolver { private final String gradleCachePath; - private final List remoteRepositories = new LinkedList(); + private final List remoteRepositories = new LinkedList<>(); public GradleResolver(String gradleCachePath) { this.gradleCachePath = gradleCachePath; diff --git a/core/container/src/main/java/org/wildfly/swarm/Swarm.java b/core/container/src/main/java/org/wildfly/swarm/Swarm.java index ceed6d1aca..003afce0e6 100644 --- a/core/container/src/main/java/org/wildfly/swarm/Swarm.java +++ b/core/container/src/main/java/org/wildfly/swarm/Swarm.java @@ -694,6 +694,7 @@ public ConfigView configView() { * @return The {@code ConfigView} through a deprecated interface. * @see #configView() */ + @SuppressWarnings("deprecation") @Deprecated public StageConfig stageConfig() { return this.configView.get(); diff --git a/core/container/src/main/java/org/wildfly/swarm/container/config/ConfigNode.java b/core/container/src/main/java/org/wildfly/swarm/container/config/ConfigNode.java index 3c1d9f6f44..88b42f74f9 100644 --- a/core/container/src/main/java/org/wildfly/swarm/container/config/ConfigNode.java +++ b/core/container/src/main/java/org/wildfly/swarm/container/config/ConfigNode.java @@ -229,7 +229,7 @@ public List asList() { } public Map asMap() { - Map map = new HashMap(); + Map map = new HashMap<>(); this.children.entrySet() .forEach(entry -> { diff --git a/core/container/src/main/java/org/wildfly/swarm/container/config/ConfigViewFactory.java b/core/container/src/main/java/org/wildfly/swarm/container/config/ConfigViewFactory.java index 187d12e53e..e0a5767b58 100644 --- a/core/container/src/main/java/org/wildfly/swarm/container/config/ConfigViewFactory.java +++ b/core/container/src/main/java/org/wildfly/swarm/container/config/ConfigViewFactory.java @@ -137,6 +137,7 @@ private void loadProjectStages(URL url) throws IOException { loadProjectStages(url.openStream()); } + @SuppressWarnings("unchecked") private void loadProjectStages(InputStream inputStream) { Yaml yaml = new Yaml(); Iterable docs = yaml.loadAll(inputStream); @@ -163,6 +164,7 @@ private void loadYamlProjectConfig(String name, URL url) throws IOException { loadYamlProjectConfig(name, url.openStream()); } + @SuppressWarnings("unchecked") private void loadYamlProjectConfig(String name, InputStream inputStream) { Yaml yaml = new Yaml(); Map doc = (Map) yaml.load(inputStream); diff --git a/core/container/src/main/java/org/wildfly/swarm/container/runtime/ConfigurableManager.java b/core/container/src/main/java/org/wildfly/swarm/container/runtime/ConfigurableManager.java index adfd82d506..6e154ec7a9 100644 --- a/core/container/src/main/java/org/wildfly/swarm/container/runtime/ConfigurableManager.java +++ b/core/container/src/main/java/org/wildfly/swarm/container/runtime/ConfigurableManager.java @@ -93,6 +93,7 @@ public List configurables() { return this.configurables; } + @SuppressWarnings("unchecked") protected void configure(ConfigurableHandle configurable) throws Exception { try (AutoCloseable handle = Performance.accumulate("ConfigurableManager#configure")) { Resolver resolver = this.configView.resolve(configurable.key()); @@ -164,7 +165,7 @@ private Resolver mapResolver(Resolver resolver, ConfigKey key) { private Converter mapConverter(ConfigKey key) { return (ignored) -> { - Map map = new HashMap(); + Map map = new HashMap<>(); Set subKeys = this.configView.simpleSubkeys(key); for (SimpleKey subKey : subKeys) { diff --git a/core/container/src/main/java/org/wildfly/swarm/container/runtime/ObjectBackedConfigurableHandle.java b/core/container/src/main/java/org/wildfly/swarm/container/runtime/ObjectBackedConfigurableHandle.java index 8e94f636ab..7e2d51b724 100644 --- a/core/container/src/main/java/org/wildfly/swarm/container/runtime/ObjectBackedConfigurableHandle.java +++ b/core/container/src/main/java/org/wildfly/swarm/container/runtime/ObjectBackedConfigurableHandle.java @@ -37,20 +37,22 @@ public Class type() throws IllegalAccessException { return this.field.getType(); } + @SuppressWarnings("unchecked") @Override public void set(T value) throws IllegalAccessException { if (isDefaultable()) { - ((Defaultable) this.field.get(this.instance)).set(value); + ((Defaultable) this.field.get(this.instance)).set(value); } else { this.field.set(this.instance, value); } } + @SuppressWarnings("unchecked") @Override public T currentValue() throws IllegalAccessException { Object value = this.field.get(this.instance); if (value instanceof Defaultable) { - return (T) ((Defaultable) value).get(); + return ((Defaultable) value).get(); } return (T) value; } diff --git a/core/container/src/main/java/org/wildfly/swarm/container/runtime/RuntimeDeployer.java b/core/container/src/main/java/org/wildfly/swarm/container/runtime/RuntimeDeployer.java index cec298e6c7..6a53d2f864 100644 --- a/core/container/src/main/java/org/wildfly/swarm/container/runtime/RuntimeDeployer.java +++ b/core/container/src/main/java/org/wildfly/swarm/container/runtime/RuntimeDeployer.java @@ -170,7 +170,7 @@ public void deploy(Archive deployment) throws DeploymentException { // check for "org.wildfly.swarm.allDependencies" flag // see DependenciesContainer#addAllDependencies() if (deployment instanceof DependenciesContainer) { - DependenciesContainer depContainer = (DependenciesContainer) deployment; + DependenciesContainer depContainer = (DependenciesContainer) deployment; if (depContainer.hasMarker(DependenciesContainer.ALL_DEPENDENCIES_MARKER)) { if (!depContainer.hasMarker(ALL_DEPENDENCIES_ADDED_MARKER)) { ApplicationEnvironment appEnv = ApplicationEnvironment.get(); @@ -181,7 +181,7 @@ public void deploy(Archive deployment) throws DeploymentException { depContainer.addAsLibrary(artifactLookup.artifact(gav)); } } else { - Set paths = appEnv.resolveDependencies(Collections.EMPTY_LIST); + Set paths = appEnv.resolveDependencies(Collections.emptyList()); for (String path : paths) { final File pathFile = new File(path); if (path.endsWith(".jar")) { @@ -294,12 +294,13 @@ public void deploy(Archive deployment) throws DeploymentException { } } + @SuppressWarnings("unused") @PreDestroy void stop() { for (Closeable each : this.mountPoints) { try { each.close(); - } catch (IOException e) { + } catch (IOException ignored) { } } @@ -309,25 +310,32 @@ void stop() { private String defaultDeploymentType; + @SuppressWarnings("unused") @Inject private ModelControllerClient client; + @SuppressWarnings("unused") @Inject private SimpleContentProvider contentProvider; + @SuppressWarnings("unused") @Inject private TempFileProvider tempFileProvider; + @SuppressWarnings("unused") @Inject private DefaultDeploymentCreator defaultDeploymentCreator; private final List mountPoints = new ArrayList<>(); + @SuppressWarnings("unused") private boolean debug = false; + @SuppressWarnings("unused") @Inject private Instance archivePreparers; + @SuppressWarnings("unused") @Inject private Instance archiveMetadataProcessors; } diff --git a/core/container/src/main/java/org/wildfly/swarm/container/runtime/cdi/ConfigViewProducingExtension.java b/core/container/src/main/java/org/wildfly/swarm/container/runtime/cdi/ConfigViewProducingExtension.java index b0297d4576..f932c3bc6e 100644 --- a/core/container/src/main/java/org/wildfly/swarm/container/runtime/cdi/ConfigViewProducingExtension.java +++ b/core/container/src/main/java/org/wildfly/swarm/container/runtime/cdi/ConfigViewProducingExtension.java @@ -40,9 +40,10 @@ public ConfigViewProducingExtension(ConfigView configView) { this.configView = configView; } + @SuppressWarnings("unused") void afterBeanDiscovery(@Observes AfterBeanDiscovery abd, BeanManager beanManager) throws Exception { try (AutoCloseable handle = Performance.time("ConfigViewProducingExtension.afterBeanDiscovery")) { - CommonBean configViewBean = CommonBeanBuilder.newBuilder() + CommonBean configViewBean = CommonBeanBuilder.newBuilder(ConfigView.class) .beanClass(ConfigViewProducingExtension.class) .scope(Singleton.class) .addQualifier(DefaultLiteral.INSTANCE) diff --git a/core/container/src/main/java/org/wildfly/swarm/container/runtime/cdi/ConfigurationValueProducer.java b/core/container/src/main/java/org/wildfly/swarm/container/runtime/cdi/ConfigurationValueProducer.java index ad90a9e91a..8e81f8df18 100644 --- a/core/container/src/main/java/org/wildfly/swarm/container/runtime/cdi/ConfigurationValueProducer.java +++ b/core/container/src/main/java/org/wildfly/swarm/container/runtime/cdi/ConfigurationValueProducer.java @@ -89,6 +89,7 @@ Double produceDoubleConfigValue(InjectionPoint injectionPoint) { return resolve(injectionPoint, Double.class); } + @SuppressWarnings("unchecked") @ConfigurationValue("") @Dependent @Produces @@ -106,6 +107,7 @@ Optional produceOptionalConfigValue(InjectionPoint injectionPoint) { return Optional.ofNullable(resolve(injectionPoint, valueType)); } + @SuppressWarnings("unchecked") private Class unwrapType(Type type) { if (type instanceof ParameterizedType) { type = ((ParameterizedType) type).getRawType(); diff --git a/core/container/src/main/java/org/wildfly/swarm/container/runtime/cdi/FractionProducingExtension.java b/core/container/src/main/java/org/wildfly/swarm/container/runtime/cdi/FractionProducingExtension.java index a3993e940e..a5b3299238 100644 --- a/core/container/src/main/java/org/wildfly/swarm/container/runtime/cdi/FractionProducingExtension.java +++ b/core/container/src/main/java/org/wildfly/swarm/container/runtime/cdi/FractionProducingExtension.java @@ -65,12 +65,13 @@ public FractionProducingExtension(Collection explicitlyInstalled, Conf * * @param abd AfterBeanDiscovery */ + @SuppressWarnings("unused") void afterBeanDiscovery(@Observes AfterBeanDiscovery abd, BeanManager beanManager) throws Exception { try (AutoCloseable handle = Performance.time("FractionProducingExtension.afterBeanDiscovery")) { Set preExistingFractionClasses = new HashSet<>(); try (AutoCloseable pre = Performance.time("FractionProducingExtension.afterBeanDiscovery - pre-existing")) { - for (Fraction fraction : explicitlyInstalledFractions) { + for (Fraction fraction : explicitlyInstalledFractions) { try { abd.addBean(new ConfigurableFractionBean<>(fraction, this.configurableManager)); } catch (Exception e) { @@ -93,21 +94,21 @@ void afterBeanDiscovery(@Observes AfterBeanDiscovery abd, BeanManager beanManage Set> fractionClasses = uninstalledFractionClasses(preExistingFractionClasses); try (AutoCloseable defaultHandle = Performance.time("FractionProducingExtension.afterBeanDiscovery - default")) { - fractionClasses.stream() - .forEach((cls) -> { - try { - abd.addBean(new ConfigurableFractionBean<>(cls, this.configurableManager)); - } catch (Exception e) { - throw new RuntimeException(e); - } - }); + fractionClasses.forEach((cls) -> { + try { + abd.addBean(new ConfigurableFractionBean<>(cls, this.configurableManager)); + } catch (Exception e) { + throw new RuntimeException(e); + } + }); } } } + @SuppressWarnings("unchecked") private Set> uninstalledFractionClasses(Set installedClasses) throws ModuleLoadException, IOException, ClassNotFoundException { - Set installedClassNames = installedClasses.stream().map(e -> e.getTypeName()).collect(Collectors.toSet()); + Set installedClassNames = installedClasses.stream().map(Type::getTypeName).collect(Collectors.toSet()); List moduleNames = ApplicationEnvironment.get().bootstrapModules(); diff --git a/core/container/src/main/java/org/wildfly/swarm/container/runtime/cdi/OutboundSocketBindingExtension.java b/core/container/src/main/java/org/wildfly/swarm/container/runtime/cdi/OutboundSocketBindingExtension.java index 60aaf29712..a3afdb8a08 100644 --- a/core/container/src/main/java/org/wildfly/swarm/container/runtime/cdi/OutboundSocketBindingExtension.java +++ b/core/container/src/main/java/org/wildfly/swarm/container/runtime/cdi/OutboundSocketBindingExtension.java @@ -48,30 +48,24 @@ public OutboundSocketBindingExtension(List binding this.bindings = bindings; } + @SuppressWarnings("unused") void afterBeanDiscovery(@Observes AfterBeanDiscovery abd, BeanManager beanManager) throws Exception { try (AutoCloseable handle = Performance.time("OutboundSocketBindingExtension.afterBeanDiscovery")) { for (OutboundSocketBindingRequest each : this.bindings) { - Supplier customizerSupplier = () -> { - return new Customizer() { - @Override - public void customize() { - Set> groups = beanManager.getBeans(SocketBindingGroup.class, AnyLiteral.INSTANCE); + Supplier customizerSupplier = () -> (Customizer) () -> { + Set> groups = beanManager.getBeans(SocketBindingGroup.class, AnyLiteral.INSTANCE); - groups.stream() - .map((Bean e) -> { - CreationalContext ctx = beanManager.createCreationalContext(e); - return (SocketBindingGroup) beanManager.getReference(e, SocketBindingGroup.class, ctx); - }) - .filter(group -> group.name().equals(each.socketBindingGroup())) - .findFirst() - .ifPresent((group) -> { - group.outboundSocketBinding(each.outboundSocketBinding()); - }); - } - }; + groups.stream() + .map((Bean e) -> { + CreationalContext ctx = beanManager.createCreationalContext(e); + return (SocketBindingGroup) beanManager.getReference(e, SocketBindingGroup.class, ctx); + }) + .filter(group -> group.name().equals(each.socketBindingGroup())) + .findFirst() + .ifPresent((group) -> group.outboundSocketBinding(each.outboundSocketBinding())); }; - CommonBean customizerBean = CommonBeanBuilder.newBuilder() + CommonBean customizerBean = CommonBeanBuilder.newBuilder(Customizer.class) .beanClass(OutboundSocketBindingExtension.class) .scope(Singleton.class) .addQualifier(new AnnotationLiteral
() {
diff --git a/core/container/src/main/java/org/wildfly/swarm/container/runtime/cdi/SocketBindingExtension.java b/core/container/src/main/java/org/wildfly/swarm/container/runtime/cdi/SocketBindingExtension.java
index 72dff4efe3..09c9246928 100644
--- a/core/container/src/main/java/org/wildfly/swarm/container/runtime/cdi/SocketBindingExtension.java
+++ b/core/container/src/main/java/org/wildfly/swarm/container/runtime/cdi/SocketBindingExtension.java
@@ -48,32 +48,26 @@ public SocketBindingExtension(List bindings) {
         this.bindings = bindings;
     }
 
+    @SuppressWarnings("unused")
     void afterBeanDiscovery(@Observes AfterBeanDiscovery abd, BeanManager beanManager) throws Exception {
         try (AutoCloseable handle = Performance.time("SocketBindingExtension.afterBeanDiscovery")) {
 
             for (SocketBindingRequest each : this.bindings) {
 
-                Supplier supplier = () -> {
-                    return new Customizer() {
-                        @Override
-                        public void customize() {
-                            Set> groups = beanManager.getBeans(SocketBindingGroup.class, AnyLiteral.INSTANCE);
+                Supplier supplier = () -> (Customizer) () -> {
+                    Set> groups = beanManager.getBeans(SocketBindingGroup.class, AnyLiteral.INSTANCE);
 
-                            groups.stream()
-                                    .map((Bean e) -> {
-                                        CreationalContext ctx = beanManager.createCreationalContext(e);
-                                        return (SocketBindingGroup) beanManager.getReference(e, SocketBindingGroup.class, ctx);
-                                    })
-                                    .filter(group -> group.name().equals(each.socketBindingGroup()))
-                                    .findFirst()
-                                    .ifPresent((group) -> {
-                                        group.socketBinding(each.socketBinding());
-                                    });
-                        }
-                    };
+                    groups.stream()
+                            .map((Bean e) -> {
+                                CreationalContext ctx = beanManager.createCreationalContext(e);
+                                return (SocketBindingGroup) beanManager.getReference(e, SocketBindingGroup.class, ctx);
+                            })
+                            .filter(group -> group.name().equals(each.socketBindingGroup()))
+                            .findFirst()
+                            .ifPresent((group) -> group.socketBinding(each.socketBinding()));
                 };
 
-                CommonBean customizerBean = CommonBeanBuilder.newBuilder()
+                CommonBean customizerBean = CommonBeanBuilder.newBuilder(Customizer.class)
                         .beanClass(SocketBindingExtension.class)
                         .scope(Singleton.class)
                         .addQualifier(new AnnotationLiteral
() {
diff --git a/core/container/src/main/java/org/wildfly/swarm/container/runtime/cdi/XMLConfigProducingExtension.java b/core/container/src/main/java/org/wildfly/swarm/container/runtime/cdi/XMLConfigProducingExtension.java
index 2e8a5109e1..a27d17953e 100644
--- a/core/container/src/main/java/org/wildfly/swarm/container/runtime/cdi/XMLConfigProducingExtension.java
+++ b/core/container/src/main/java/org/wildfly/swarm/container/runtime/cdi/XMLConfigProducingExtension.java
@@ -44,7 +44,7 @@ public XMLConfigProducingExtension(Optional xmlConfig) {
 
     void afterBeanDiscovery(@Observes AfterBeanDiscovery abd, BeanManager beanManager) throws Exception {
         try (AutoCloseable handle = Performance.time("XMLConfigProducingExtension.afterBeanDiscovery")) {
-            CommonBean urlBean = CommonBeanBuilder.newBuilder()
+            CommonBean urlBean = CommonBeanBuilder.newBuilder(URL.class)
                     .beanClass(XMLConfigProducingExtension.class)
                     .scope(Dependent.class)
                     .addQualifier(XMLConfig.Literal.INSTANCE)
@@ -55,7 +55,7 @@ void afterBeanDiscovery(@Observes AfterBeanDiscovery abd, BeanManager beanManage
         }
     }
 
-    protected URL getXMLConfig() {
+    private URL getXMLConfig() {
         if (this.xmlConfig.isPresent()) {
             return this.xmlConfig.get();
         }
diff --git a/core/container/src/main/java/org/wildfly/swarm/container/runtime/cdi/configurable/ConfigurableExtension.java b/core/container/src/main/java/org/wildfly/swarm/container/runtime/cdi/configurable/ConfigurableExtension.java
index 1219f25e13..7e601931b9 100644
--- a/core/container/src/main/java/org/wildfly/swarm/container/runtime/cdi/configurable/ConfigurableExtension.java
+++ b/core/container/src/main/java/org/wildfly/swarm/container/runtime/cdi/configurable/ConfigurableExtension.java
@@ -55,15 +55,16 @@ public ConfigurableExtension(ConfigurableManager configurableManager) {
         this.configurableManager = configurableManager;
     }
 
-    void processInjectionTarget(@Observes ProcessInjectionTarget pit, BeanManager beanManager) throws Exception {
+    @SuppressWarnings("unused")
+     void processInjectionTarget(@Observes ProcessInjectionTarget pit, BeanManager beanManager) throws Exception {
         try (AutoCloseable handle = Performance.accumulate("ConfigurationExtension.processInjectionTarget")) {
             if (isApplicable(pit.getAnnotatedType())) {
-                pit.setInjectionTarget(new ConfigurableInjectionTarget<>(pit.getInjectionTarget(), this.configurableManager));
+                pit.setInjectionTarget(new ConfigurableInjectionTarget(pit.getInjectionTarget(), this.configurableManager));
             }
         }
     }
 
-    static  boolean isApplicable(AnnotatedType at) {
+    private static  boolean isApplicable(AnnotatedType at) {
         if (isApplicable(at.getJavaClass())) {
             return true;
         }
@@ -79,7 +80,7 @@ static  boolean isApplicable(AnnotatedType at) {
         return false;
     }
 
-    static boolean isApplicable(Class cls) {
+    private static boolean isApplicable(Class cls) {
         for (Class each : APPLICABLE_CLASSES) {
             if (each.isAssignableFrom(cls)) {
                 return true;
@@ -89,10 +90,11 @@ static boolean isApplicable(Class cls) {
         return false;
     }
 
+    @SuppressWarnings({"unused"})
     void afterBeanDiscovery(@Observes AfterBeanDiscovery abd) throws Exception {
         try (AutoCloseable handle = Performance.time("ConfigurationExtension.afterBeanDiscovery")) {
-            CommonBean configurableManagerBean = CommonBeanBuilder.newBuilder()
-                    .beanClass(ConfigurableExtension.class)
+            CommonBean configurableManagerBean = CommonBeanBuilder.newBuilder(ConfigurableManager.class)
+                    .beanClass(ConfigurableManager.class)
                     .scope(Singleton.class)
                     .addQualifier(DefaultLiteral.INSTANCE)
                     .createSupplier(() -> configurableManager)
diff --git a/core/container/src/main/java/org/wildfly/swarm/container/runtime/cli/CommandLineArgsExtension.java b/core/container/src/main/java/org/wildfly/swarm/container/runtime/cli/CommandLineArgsExtension.java
index edc71bde2b..b008ca5c36 100644
--- a/core/container/src/main/java/org/wildfly/swarm/container/runtime/cli/CommandLineArgsExtension.java
+++ b/core/container/src/main/java/org/wildfly/swarm/container/runtime/cli/CommandLineArgsExtension.java
@@ -44,7 +44,7 @@ public CommandLineArgsExtension(String... args) {
     }
 
     void afterBeanDiscovery(@Observes AfterBeanDiscovery abd) {
-        CommonBean stringBean = CommonBeanBuilder.newBuilder()
+        CommonBean stringBean = CommonBeanBuilder.newBuilder(String[].class)
                 .beanClass(CommandLineArgsExtension.class)
                 .scope(Dependent.class)
                 .createSupplier(() -> args)
@@ -52,7 +52,7 @@ void afterBeanDiscovery(@Observes AfterBeanDiscovery abd) {
                 .addType(String[].class)
                 .addType(Object.class).build();
         abd.addBean(stringBean);
-        CommonBean> listBean = CommonBeanBuilder.newBuilder()
+        CommonBean listBean = CommonBeanBuilder.newBuilder(List.class)
                 .beanClass(CommandLineArgsExtension.class)
                 .scope(Dependent.class)
                 .createSupplier(() -> argsList)
diff --git a/core/container/src/main/java/org/wildfly/swarm/container/runtime/xmlconfig/BootstrapPersister.java b/core/container/src/main/java/org/wildfly/swarm/container/runtime/xmlconfig/BootstrapPersister.java
index c9f12989c5..0f6de49cb9 100644
--- a/core/container/src/main/java/org/wildfly/swarm/container/runtime/xmlconfig/BootstrapPersister.java
+++ b/core/container/src/main/java/org/wildfly/swarm/container/runtime/xmlconfig/BootstrapPersister.java
@@ -13,6 +13,7 @@
 import org.jboss.as.controller.RunningMode;
 import org.jboss.as.controller.RunningModeControl;
 import org.jboss.as.controller.extension.ExtensionRegistry;
+import org.jboss.as.controller.extension.RuntimeHostControllerInfoAccessor;
 import org.jboss.as.controller.parsing.Namespace;
 import org.jboss.as.controller.persistence.ConfigurationPersistenceException;
 import org.jboss.as.controller.persistence.ConfigurationPersister;
@@ -98,7 +99,13 @@ public void unregisterSubsystemWriter(String name) {
     private XmlConfigurationPersister createDelegate(File configFile) {
 
         QName rootElement = new QName(Namespace.CURRENT.getUriString(), "server");
-        ExtensionRegistry extensionRegistry = new ExtensionRegistry(ProcessType.SELF_CONTAINED, new RunningModeControl(RunningMode.NORMAL));
+        ExtensionRegistry extensionRegistry = new ExtensionRegistry(
+                ProcessType.SELF_CONTAINED,
+                new RunningModeControl(RunningMode.NORMAL),
+                null,
+                null,
+                RuntimeHostControllerInfoAccessor.SERVER
+        );
         StandaloneXml parser = new StandaloneXml(Module.getBootModuleLoader(), Executors.newSingleThreadExecutor(), extensionRegistry);
 
         XmlConfigurationPersister persister = new XmlConfigurationPersister(
diff --git a/core/container/src/main/java/org/wildfly/swarm/container/runtime/xmlconfig/StandaloneXMLParser.java b/core/container/src/main/java/org/wildfly/swarm/container/runtime/xmlconfig/StandaloneXMLParser.java
index cd87847cb5..ee0aca3aa1 100644
--- a/core/container/src/main/java/org/wildfly/swarm/container/runtime/xmlconfig/StandaloneXMLParser.java
+++ b/core/container/src/main/java/org/wildfly/swarm/container/runtime/xmlconfig/StandaloneXMLParser.java
@@ -62,7 +62,7 @@ public void parseExtensions(XMLExtendedStreamReader reader, ModelNode address, N
 
             @Override
             public Set getProfileParsingCompletionHandlers() {
-                return Collections.EMPTY_SET;
+                return Collections.emptySet();
             }
 
             @Override
diff --git a/core/container/src/test/java/org/wildfly/swarm/cli/CommandLineTest.java b/core/container/src/test/java/org/wildfly/swarm/cli/CommandLineTest.java
index 0f5adc31c8..babfaa1691 100644
--- a/core/container/src/test/java/org/wildfly/swarm/cli/CommandLineTest.java
+++ b/core/container/src/test/java/org/wildfly/swarm/cli/CommandLineTest.java
@@ -96,7 +96,7 @@ public void testProperties() throws Exception {
     @Test
     public void testLongArgWithEqual() throws Exception {
         String fileName = "my.properties";
-        String expectedPath = new File(System.getProperty("user.dir"), fileName).toURL().toString();
+        String expectedPath = new File(System.getProperty("user.dir"), fileName).toURI().toURL().toString();
 
         CommandLine cmd = CommandLine.parse("--properties=" + fileName);
 
@@ -106,7 +106,7 @@ public void testLongArgWithEqual() throws Exception {
     @Test
     public void testLongArgWithoutEqual() throws Exception {
         String fileName = "my.properties";
-        String expectedPath = new File(System.getProperty("user.dir"), fileName).toURL().toString();
+        String expectedPath = new File(System.getProperty("user.dir"), fileName).toURI().toURL().toString();
 
         CommandLine cmd = CommandLine.parse("--properties", fileName);
 
diff --git a/core/container/src/test/java/org/wildfly/swarm/container/config/ConfigViewYamlTest.java b/core/container/src/test/java/org/wildfly/swarm/container/config/ConfigViewYamlTest.java
index 42d7248253..17f2780fb9 100644
--- a/core/container/src/test/java/org/wildfly/swarm/container/config/ConfigViewYamlTest.java
+++ b/core/container/src/test/java/org/wildfly/swarm/container/config/ConfigViewYamlTest.java
@@ -14,6 +14,7 @@
  */
 public class ConfigViewYamlTest {
 
+    @SuppressWarnings("unchecked")
     @Test
     public void testYamlWithLiteralLists() throws Exception {
         URL url = getClass().getClassLoader().getResource("project-lists.yml");
diff --git a/core/container/src/test/java/org/wildfly/swarm/container/config/MapConfigNodeFactoryTest.java b/core/container/src/test/java/org/wildfly/swarm/container/config/MapConfigNodeFactoryTest.java
index defe0e310a..2a86c5e3da 100644
--- a/core/container/src/test/java/org/wildfly/swarm/container/config/MapConfigNodeFactoryTest.java
+++ b/core/container/src/test/java/org/wildfly/swarm/container/config/MapConfigNodeFactoryTest.java
@@ -17,14 +17,14 @@ public class MapConfigNodeFactoryTest {
     @Test
     public void testLoad() {
 
-        Map input = new HashMap() {{
-            put("swarm", new HashMap() {{
+        Map input = new HashMap() {{
+            put("swarm", new HashMap() {{
                 put("port", 8080);
                 put("enabled", true);
-                put("things", new ArrayList() {{
+                put("things", new ArrayList() {{
                     add("one");
                     add("two");
-                    add(new HashMap() {{
+                    add(new HashMap() {{
                         put("name", "three");
                         put("cheese", "cheddar");
                         put("item", 3);
diff --git a/core/spi/src/main/java/org/wildfly/swarm/spi/api/Fraction.java b/core/spi/src/main/java/org/wildfly/swarm/spi/api/Fraction.java
index b3b804a0bd..38eb843a2d 100644
--- a/core/spi/src/main/java/org/wildfly/swarm/spi/api/Fraction.java
+++ b/core/spi/src/main/java/org/wildfly/swarm/spi/api/Fraction.java
@@ -41,6 +41,7 @@ public interface Fraction {
      *
      * @return this fraction.
      */
+    @SuppressWarnings("unchecked")
     default T applyDefaults() {
         return (T) this;
     }
diff --git a/core/spi/src/main/java/org/wildfly/swarm/spi/api/cdi/CommonBeanBuilder.java b/core/spi/src/main/java/org/wildfly/swarm/spi/api/cdi/CommonBeanBuilder.java
index dd56271196..65c835822c 100644
--- a/core/spi/src/main/java/org/wildfly/swarm/spi/api/cdi/CommonBeanBuilder.java
+++ b/core/spi/src/main/java/org/wildfly/swarm/spi/api/cdi/CommonBeanBuilder.java
@@ -37,31 +37,31 @@ public class CommonBeanBuilder {
         this.types = new HashSet<>();
     }
 
-    public static CommonBeanBuilder newBuilder() {
-        return new CommonBeanBuilder();
+    public static  CommonBeanBuilder newBuilder(Class beanClass) {
+        return new CommonBeanBuilder();
     }
 
-    public CommonBeanBuilder beanClass(Class beanClass) {
+    public CommonBeanBuilder beanClass(Class beanClass) {
         this.beanClass = beanClass;
         return this;
     }
 
-    public CommonBeanBuilder scope(Class scope) {
+    public CommonBeanBuilder scope(Class scope) {
         this.scope = scope;
         return this;
     }
 
-    public CommonBeanBuilder addQualifier(Annotation qualifier) {
+    public CommonBeanBuilder addQualifier(Annotation qualifier) {
         qualifiers.add(qualifier);
         return this;
     }
 
-    public CommonBeanBuilder createSupplier(Supplier createSupplier) {
+    public CommonBeanBuilder createSupplier(Supplier createSupplier) {
         this.createSupplier = createSupplier;
         return this;
     }
 
-    public CommonBeanBuilder addType(Type type) {
+    public CommonBeanBuilder addType(Type type) {
         types.add(type);
         return this;
     }
diff --git a/core/spi/src/main/java/org/wildfly/swarm/spi/api/config/Builder.java b/core/spi/src/main/java/org/wildfly/swarm/spi/api/config/Builder.java
index 48694926e7..9bd44981dd 100644
--- a/core/spi/src/main/java/org/wildfly/swarm/spi/api/config/Builder.java
+++ b/core/spi/src/main/java/org/wildfly/swarm/spi/api/config/Builder.java
@@ -14,11 +14,13 @@ public Builder(ConfigView view, ConfigKey key) {
         this.key = key;
     }
 
+    @SuppressWarnings("unchecked")
     public  Resolver as(Class clazz) {
         targetType = clazz;
         return (Resolver) this;
     }
 
+    @SuppressWarnings("unchecked")
     @Override
     public  Resolver as(Class clazz, Converter converter) {
         targetType = clazz;
@@ -31,6 +33,7 @@ public ConfigKey getKey() {
         return key;
     }
 
+    @SuppressWarnings("unchecked")
     @Override
     public T getValue() {
 
@@ -71,6 +74,7 @@ public Resolver withDefault(T value) {
         return this;
     }
 
+    @SuppressWarnings("unchecked")
     private T convert(String value) throws MalformedURLException {
 
         if (value == null) {
diff --git a/core/spi/src/main/java/org/wildfly/swarm/spi/api/config/ConfigView.java b/core/spi/src/main/java/org/wildfly/swarm/spi/api/config/ConfigView.java
index 345a13d5b3..8a85c60c49 100644
--- a/core/spi/src/main/java/org/wildfly/swarm/spi/api/config/ConfigView.java
+++ b/core/spi/src/main/java/org/wildfly/swarm/spi/api/config/ConfigView.java
@@ -9,6 +9,7 @@
 /**
  * @author Bob McWhirter
  */
+@SuppressWarnings("deprecation")
 public interface ConfigView extends StageConfig {
 
     Object valueOf(ConfigKey key);
diff --git a/fractions/cdi-extensions/cdi-config/src/main/java/org/wildfly/swarm/cdi/config/deployment/ConfigViewBean.java b/fractions/cdi-extensions/cdi-config/src/main/java/org/wildfly/swarm/cdi/config/deployment/ConfigViewBean.java
index 7f6e2e1da0..1ec4f2dfc8 100644
--- a/fractions/cdi-extensions/cdi-config/src/main/java/org/wildfly/swarm/cdi/config/deployment/ConfigViewBean.java
+++ b/fractions/cdi-extensions/cdi-config/src/main/java/org/wildfly/swarm/cdi/config/deployment/ConfigViewBean.java
@@ -50,7 +50,7 @@ public Class getBeanClass() {
 
     @Override
     public Set getInjectionPoints() {
-        return Collections.EMPTY_SET;
+        return Collections.emptySet();
     }
 
     @Override
@@ -84,7 +84,7 @@ public String getName() {
 
     @Override
     public Set> getStereotypes() {
-        return Collections.EMPTY_SET;
+        return Collections.emptySet();
     }
 
     @Override
diff --git a/fractions/javaee/datasources/src/main/java/org/wildfly/swarm/datasources/runtime/DriverInfo.java b/fractions/javaee/datasources/src/main/java/org/wildfly/swarm/datasources/runtime/DriverInfo.java
index 93ec71f066..e62d6261e7 100644
--- a/fractions/javaee/datasources/src/main/java/org/wildfly/swarm/datasources/runtime/DriverInfo.java
+++ b/fractions/javaee/datasources/src/main/java/org/wildfly/swarm/datasources/runtime/DriverInfo.java
@@ -223,6 +223,7 @@ public String toString() {
         return "[DriverInfo: detectable=" + this.detectableClassName + "]";
     }
 
+    @SuppressWarnings("unchecked")
     public void installDatasource(DatasourcesFraction fraction, String dsName, DataSourceConsumer config) {
         fraction.dataSource(dsName, (ds) -> {
             ds.driverName(this.name);
diff --git a/fractions/javaee/ee/src/main/java/org/wildfly/swarm/ee/EEFraction.java b/fractions/javaee/ee/src/main/java/org/wildfly/swarm/ee/EEFraction.java
index 61321b97c4..379dd1cf64 100644
--- a/fractions/javaee/ee/src/main/java/org/wildfly/swarm/ee/EEFraction.java
+++ b/fractions/javaee/ee/src/main/java/org/wildfly/swarm/ee/EEFraction.java
@@ -61,6 +61,7 @@ public EEFraction applyDefaults() {
         return applyDefaults(null);
     }
 
+    @SuppressWarnings("unchecked")
     public EEFraction applyDefaults(DefaultBindingsServiceConsumer config) {
         specDescriptorPropertyReplacement(false)
                 .contextService(new ContextService(DEFAULT_KEY)
diff --git a/fractions/javaee/messaging/src/main/java/org/wildfly/swarm/messaging/EnhancedServer.java b/fractions/javaee/messaging/src/main/java/org/wildfly/swarm/messaging/EnhancedServer.java
index 3337afa737..6de552e685 100644
--- a/fractions/javaee/messaging/src/main/java/org/wildfly/swarm/messaging/EnhancedServer.java
+++ b/fractions/javaee/messaging/src/main/java/org/wildfly/swarm/messaging/EnhancedServer.java
@@ -154,7 +154,7 @@ public EnhancedServer remoteConnection(RemoteConnection.Supplier supplier) {
     public EnhancedServer enableRemote() {
         enableHTTPConnections();
 
-        connectionFactory(new ConnectionFactory("RemoteConnectionFactory")
+        connectionFactory(new ConnectionFactory<>("RemoteConnectionFactory")
                                   .connectors(Collections.singletonList("http-connector"))
                                   .entries("java:/RemoteConnectionFactory", "java:jboss/exported/jms/RemoteConnectionFactory"));
         return this;
diff --git a/fractions/javaee/undertow/src/main/java/org/wildfly/swarm/undertow/runtime/HttpSecurityPreparer.java b/fractions/javaee/undertow/src/main/java/org/wildfly/swarm/undertow/runtime/HttpSecurityPreparer.java
index d00ed6f304..b917d2ea14 100644
--- a/fractions/javaee/undertow/src/main/java/org/wildfly/swarm/undertow/runtime/HttpSecurityPreparer.java
+++ b/fractions/javaee/undertow/src/main/java/org/wildfly/swarm/undertow/runtime/HttpSecurityPreparer.java
@@ -41,6 +41,7 @@ public class HttpSecurityPreparer implements ArchivePreparer {
 
     private final String[] SUPPORTED_AUTH_METHODS = new String[] {"BASIC", "DIGEST", "FORM", "KEYCLOAK"};
 
+    @SuppressWarnings("unchecked")
     @Override
     public void prepareArchive(Archive archive) {
 
diff --git a/fractions/javaee/undertow/src/test/java/org/wildfly/swarm/undertow/runtime/ContextPathArchivePreparerTest.java b/fractions/javaee/undertow/src/test/java/org/wildfly/swarm/undertow/runtime/ContextPathArchivePreparerTest.java
index 3b7cae599f..b427a28536 100644
--- a/fractions/javaee/undertow/src/test/java/org/wildfly/swarm/undertow/runtime/ContextPathArchivePreparerTest.java
+++ b/fractions/javaee/undertow/src/test/java/org/wildfly/swarm/undertow/runtime/ContextPathArchivePreparerTest.java
@@ -78,6 +78,7 @@ public void testContextPathProperty() throws Exception {
         assertThat(archive.getContextRoot()).isEqualTo("/another-root");
     }
 
+    @SuppressWarnings("unchecked")
     @Test
     public void testExternalMount() throws Exception {
         WARArchive archive = DefaultWarDeploymentFactory.archiveFromCurrentApp();
diff --git a/fractions/javaee/undertow/src/test/java/org/wildfly/swarm/undertow/runtime/HttpSecurityPreparerTest.java b/fractions/javaee/undertow/src/test/java/org/wildfly/swarm/undertow/runtime/HttpSecurityPreparerTest.java
index 36269d54a6..5899757e0d 100644
--- a/fractions/javaee/undertow/src/test/java/org/wildfly/swarm/undertow/runtime/HttpSecurityPreparerTest.java
+++ b/fractions/javaee/undertow/src/test/java/org/wildfly/swarm/undertow/runtime/HttpSecurityPreparerTest.java
@@ -47,6 +47,7 @@ public void do_nothing_if_not_specified_security_constraints() throws Exception
         assertThat(archive.get(WebXmlAsset.NAME)).isNull();
     }
 
+    @SuppressWarnings("unchecked")
     @Test
     public void yaml_parsing() throws Exception {
 
@@ -114,6 +115,7 @@ public void set_1_security_constraint() throws Exception {
         }
     }
 
+    @SuppressWarnings("unchecked")
     private Map findWebConfig(Map deploymentConfig) {
         String[] path = new String[] {archive.getName(), "web"};
         Map curr = deploymentConfig;
diff --git a/fractions/javaee/undertow/src/test/java/org/wildfly/swarm/undertow/runtime/MockInstance.java b/fractions/javaee/undertow/src/test/java/org/wildfly/swarm/undertow/runtime/MockInstance.java
index 2fc632876e..c148913ea3 100644
--- a/fractions/javaee/undertow/src/test/java/org/wildfly/swarm/undertow/runtime/MockInstance.java
+++ b/fractions/javaee/undertow/src/test/java/org/wildfly/swarm/undertow/runtime/MockInstance.java
@@ -1,8 +1,10 @@
 package org.wildfly.swarm.undertow.runtime;
 
 import java.lang.annotation.Annotation;
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Iterator;
+import java.util.List;
 
 import javax.enterprise.inject.Instance;
 import javax.enterprise.util.TypeLiteral;
@@ -55,7 +57,7 @@ public Iterator iterator() {
             return Collections.singleton(this.instance).iterator();
         }
 
-        return (Iterator) Collections.emptyList().iterator();
+        return new ArrayList().iterator();
     }
 
     @Override
diff --git a/fractions/jolokia/src/main/java/org/wildfly/swarm/jolokia/access/ConfigurationValueAccessPreparer.java b/fractions/jolokia/src/main/java/org/wildfly/swarm/jolokia/access/ConfigurationValueAccessPreparer.java
index 1fd3b8cfc2..96539652c1 100644
--- a/fractions/jolokia/src/main/java/org/wildfly/swarm/jolokia/access/ConfigurationValueAccessPreparer.java
+++ b/fractions/jolokia/src/main/java/org/wildfly/swarm/jolokia/access/ConfigurationValueAccessPreparer.java
@@ -30,7 +30,7 @@ protected Asset getJolokiaAccessXmlAsset() {
             } catch (MalformedURLException e) {
                 File file = new File(this.jolokiaAccessXml);
                 if (file.exists()) {
-                    url = file.toURL();
+                    url = file.toURI().toURL();
                 }
             }
 
diff --git a/fractions/keycloak/src/main/java/org/wildfly/swarm/keycloak/deployment/KeycloakThreadSetupHandler.java b/fractions/keycloak/src/main/java/org/wildfly/swarm/keycloak/deployment/KeycloakThreadSetupHandler.java
new file mode 100644
index 0000000000..c8d2ebfc57
--- /dev/null
+++ b/fractions/keycloak/src/main/java/org/wildfly/swarm/keycloak/deployment/KeycloakThreadSetupHandler.java
@@ -0,0 +1,33 @@
+package org.wildfly.swarm.keycloak.deployment;
+
+import io.undertow.server.HttpServerExchange;
+import io.undertow.servlet.api.ThreadSetupHandler;
+import org.keycloak.KeycloakSecurityContext;
+import org.keycloak.adapters.undertow.OIDCUndertowHttpFacade;
+
+/**
+ * @author Bob McWhirter
+ */
+class KeycloakThreadSetupHandler implements ThreadSetupHandler {
+    @Override
+    public  Action create(final Action action) {
+
+        return new Action() {
+
+            @Override
+            public T call(HttpServerExchange exchange, C context) throws Exception {
+                if (exchange == null) {
+                    return null;
+                }
+                KeycloakSecurityContext c = exchange.getAttachment(OIDCUndertowHttpFacade.KEYCLOAK_SECURITY_CONTEXT_KEY);
+                KeycloakSecurityContextAssociation.associate(c);
+                try {
+                    return action.call(exchange, context);
+                } finally {
+                    KeycloakSecurityContextAssociation.disassociate();
+                }
+            }
+        };
+    }
+
+}
diff --git a/fractions/keycloak/src/main/java/org/wildfly/swarm/keycloak/deployment/SecurityContextServletExtension.java b/fractions/keycloak/src/main/java/org/wildfly/swarm/keycloak/deployment/SecurityContextServletExtension.java
index fbfb09ecfa..5168fdbf4a 100644
--- a/fractions/keycloak/src/main/java/org/wildfly/swarm/keycloak/deployment/SecurityContextServletExtension.java
+++ b/fractions/keycloak/src/main/java/org/wildfly/swarm/keycloak/deployment/SecurityContextServletExtension.java
@@ -17,57 +17,31 @@
 
 import javax.servlet.ServletContext;
 
-import io.undertow.server.HandlerWrapper;
-import io.undertow.server.HttpHandler;
-import io.undertow.server.HttpServerExchange;
 import io.undertow.servlet.ServletExtension;
 import io.undertow.servlet.api.DeploymentInfo;
-import io.undertow.servlet.api.ThreadSetupAction;
 import org.keycloak.KeycloakSecurityContext;
 import org.keycloak.adapters.undertow.OIDCUndertowHttpFacade;
 
 /**
  * @author Bob McWhirter
  */
+@SuppressWarnings("unused")
 public class SecurityContextServletExtension implements ServletExtension {
     @Override
     public void handleDeployment(DeploymentInfo info, ServletContext context) {
-        info.addThreadSetupAction(new ThreadSetupAction() {
-            @Override
-            public Handle setup(HttpServerExchange exchange) {
-                if (exchange == null) {
-                    return null;
-                }
-                KeycloakSecurityContext c = exchange.getAttachment(OIDCUndertowHttpFacade.KEYCLOAK_SECURITY_CONTEXT_KEY);
+        info.addThreadSetupAction(new KeycloakThreadSetupHandler());
+
+        info.addInnerHandlerChainWrapper(next -> exchange -> {
+            KeycloakSecurityContext c = exchange.getAttachment(OIDCUndertowHttpFacade.KEYCLOAK_SECURITY_CONTEXT_KEY);
+            if (c != null) {
                 KeycloakSecurityContextAssociation.associate(c);
-                return new Handle() {
-                    @Override
-                    public void tearDown() {
-                        KeycloakSecurityContextAssociation.disassociate();
-                    }
-                };
             }
-        });
-
-        info.addInnerHandlerChainWrapper(new HandlerWrapper() {
-            @Override
-            public HttpHandler wrap(HttpHandler next) {
-                return new HttpHandler() {
-                    @Override
-                    public void handleRequest(HttpServerExchange exchange) throws Exception {
-                        KeycloakSecurityContext c = exchange.getAttachment(OIDCUndertowHttpFacade.KEYCLOAK_SECURITY_CONTEXT_KEY);
-                        if (c != null) {
-                            KeycloakSecurityContextAssociation.associate(c);
-                        }
-
-                        try {
-                            next.handleRequest(exchange);
-                        } finally {
-                            KeycloakSecurityContextAssociation.disassociate();
-                        }
-                    }
-                };
+            try {
+                next.handleRequest(exchange);
+            } finally {
+                KeycloakSecurityContextAssociation.disassociate();
             }
         });
     }
+
 }
diff --git a/fractions/monitor/src/main/java/org/wildfly/swarm/monitor/runtime/InVMConnection.java b/fractions/monitor/src/main/java/org/wildfly/swarm/monitor/runtime/InVMConnection.java
index 61d4461894..7edc2c8933 100644
--- a/fractions/monitor/src/main/java/org/wildfly/swarm/monitor/runtime/InVMConnection.java
+++ b/fractions/monitor/src/main/java/org/wildfly/swarm/monitor/runtime/InVMConnection.java
@@ -63,6 +63,7 @@ public void flushTo(StringBuffer sb) {
         bufferSink.flushTo(sb);
     }
 
+    @SuppressWarnings("deprecation")
     @Override
     public Pool getBufferPool() {
         if (poolAdaptor == null) {
@@ -190,18 +191,12 @@ public ConduitStreamSinkChannel getSinkChannel() {
                         new PooledAdaptor(bufferPool.allocate())
                 )
         );
-        sinkChannel.setCloseListener(new ChannelListener() {
-            @Override
-            public void handleEvent(ConduitStreamSinkChannel conduitStreamSinkChannel) {
+        sinkChannel.setCloseListener(conduitStreamSinkChannel -> {
+            for (CloseListener l : closeListeners) {
                 try {
-                    for (CloseListener l : closeListeners) {
-                        try {
-                            l.closed(InVMConnection.this);
-                        } catch (Throwable e) {
-                            UndertowLogger.REQUEST_LOGGER.exceptionInvokingCloseListener(l, e);
-                        }
-                    }
-                } finally {
+                    l.closed(InVMConnection.this);
+                } catch (Throwable e) {
+                    UndertowLogger.REQUEST_LOGGER.exceptionInvokingCloseListener(l, e);
                 }
             }
         });
diff --git a/fractions/topology-webapp/src/main/java/org/wildfly/swarm/topology/webapp/runtime/TopologyProxiedServiceCustomizer.java b/fractions/topology-webapp/src/main/java/org/wildfly/swarm/topology/webapp/runtime/TopologyProxiedServiceCustomizer.java
index 6ae5fb4ac7..c8bdd8a986 100644
--- a/fractions/topology-webapp/src/main/java/org/wildfly/swarm/topology/webapp/runtime/TopologyProxiedServiceCustomizer.java
+++ b/fractions/topology-webapp/src/main/java/org/wildfly/swarm/topology/webapp/runtime/TopologyProxiedServiceCustomizer.java
@@ -41,9 +41,11 @@
 @ApplicationScoped
 public class TopologyProxiedServiceCustomizer implements Customizer {
 
+    @SuppressWarnings("unused")
     @Inject @Any
     private UndertowFraction undertow;
 
+    @SuppressWarnings("unused")
     @Inject @Any
     private TopologyWebAppFraction fraction;
 
@@ -52,7 +54,7 @@ public void customize() {
         if (!mappings.isEmpty()) {
             HandlerConfiguration handlerConfig = undertow.subresources().handlerConfiguration();
             for (String serviceName : mappings.keySet()) {
-                ReverseProxy proxy = new ReverseProxy(proxyHandlerName(serviceName)).hosts(Collections.emptyList());
+                ReverseProxy proxy = new ReverseProxy<>(proxyHandlerName(serviceName)).hosts(Collections.emptyList());
                 handlerConfig.reverseProxy(proxy);
 
                 String contextPath = mappings.get(serviceName);
diff --git a/fractions/topology/src/test/java/org/wildfly/swarm/topology/runtime/AdvertisingMetadataProcessorTest.java b/fractions/topology/src/test/java/org/wildfly/swarm/topology/runtime/AdvertisingMetadataProcessorTest.java
index 9e344465a3..7f50eafdf4 100644
--- a/fractions/topology/src/test/java/org/wildfly/swarm/topology/runtime/AdvertisingMetadataProcessorTest.java
+++ b/fractions/topology/src/test/java/org/wildfly/swarm/topology/runtime/AdvertisingMetadataProcessorTest.java
@@ -66,7 +66,7 @@ public void testWithRepeatingAnnotation() throws IOException {
         assertThat(advertisements).contains("gouda");
     }
 
-    Index createIndex(Archive archive) throws IOException {
+    Index createIndex(Archive archive) throws IOException {
         Indexer indexer = new Indexer();
 
         Map c = archive.getContent();
diff --git a/fractions/vertx/src/main/java/org/wildfly/swarm/vertx/runtime/VertxAdapterCustomizer.java b/fractions/vertx/src/main/java/org/wildfly/swarm/vertx/runtime/VertxAdapterCustomizer.java
index ca4c1170e5..c8a8e64313 100644
--- a/fractions/vertx/src/main/java/org/wildfly/swarm/vertx/runtime/VertxAdapterCustomizer.java
+++ b/fractions/vertx/src/main/java/org/wildfly/swarm/vertx/runtime/VertxAdapterCustomizer.java
@@ -40,6 +40,7 @@ public class VertxAdapterCustomizer implements Customizer {
     @Inject
     Instance vertxFractionInstance;
 
+    @SuppressWarnings("unchecked")
     @Override
     public void customize() {
         if (!resourceAdapterFractionInstance.isUnsatisfied() && !vertxFractionInstance.isUnsatisfied()) {
diff --git a/meta/fraction-metadata/src/main/java/org/wildfly/swarm/fractions/FractionUsageAnalyzer.java b/meta/fraction-metadata/src/main/java/org/wildfly/swarm/fractions/FractionUsageAnalyzer.java
index 9f1cc9fdcd..d255eec5e7 100644
--- a/meta/fraction-metadata/src/main/java/org/wildfly/swarm/fractions/FractionUsageAnalyzer.java
+++ b/meta/fraction-metadata/src/main/java/org/wildfly/swarm/fractions/FractionUsageAnalyzer.java
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright 2015-2016 Red Hat, Inc, and individual contributors.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -150,6 +150,7 @@ private  Collection> convertDetectors(Collection FractionDetector convert(FractionDetector detector) {
         return (FractionDetector) detector;
     }
diff --git a/plugin/src/main/java/org/wildfly/swarm/plugin/gradle/GradleArtifactResolvingHelper.java b/plugin/src/main/java/org/wildfly/swarm/plugin/gradle/GradleArtifactResolvingHelper.java
index 9679213ce8..764407820c 100644
--- a/plugin/src/main/java/org/wildfly/swarm/plugin/gradle/GradleArtifactResolvingHelper.java
+++ b/plugin/src/main/java/org/wildfly/swarm/plugin/gradle/GradleArtifactResolvingHelper.java
@@ -74,7 +74,7 @@ public ArtifactSpec resolve(final ArtifactSpec spec) {
     @Override
     public Set resolveAll(final Collection specs, boolean transitive, boolean defaultExcludes) throws Exception {
         if (specs.isEmpty()) {
-            return Collections.EMPTY_SET;
+            return Collections.emptySet();
         }
 
         return doResolve(specs, transitive)
diff --git a/plugin/src/main/java/org/wildfly/swarm/plugin/maven/MavenArtifactResolvingHelper.java b/plugin/src/main/java/org/wildfly/swarm/plugin/maven/MavenArtifactResolvingHelper.java
index 75b370ac5c..1c05645f45 100644
--- a/plugin/src/main/java/org/wildfly/swarm/plugin/maven/MavenArtifactResolvingHelper.java
+++ b/plugin/src/main/java/org/wildfly/swarm/plugin/maven/MavenArtifactResolvingHelper.java
@@ -109,9 +109,9 @@ public ArtifactSpec resolve(ArtifactSpec spec) {
     @Override
     public Set resolveAll(Collection specs, boolean transitive, boolean defaultExcludes) throws Exception {
         if (specs.isEmpty()) {
-            return Collections.EMPTY_SET;
+            return Collections.emptySet();
         }
-        List nodes = null;
+        List nodes;
         if (transitive) {
 
             final CollectRequest request = new CollectRequest();
@@ -203,7 +203,7 @@ private void resolveDependenciesInParallel(List nodes) {
         }
     }
 
-    protected RemoteRepository buildRemoteRepository(final String id, final String url, final Authentication auth) {
+    private RemoteRepository buildRemoteRepository(final String id, final String url, final Authentication auth) {
         RemoteRepository.Builder builder = new RemoteRepository.Builder(id, "default", url);
         if (auth != null
                 && auth.getUsername() != null
diff --git a/testsuite/testsuite-infinispan/src/main/java/org/wildfly/swarm/infinispan/test/MyResource.java b/testsuite/testsuite-infinispan/src/main/java/org/wildfly/swarm/infinispan/test/MyResource.java
index 70dfdd3080..8461d802eb 100644
--- a/testsuite/testsuite-infinispan/src/main/java/org/wildfly/swarm/infinispan/test/MyResource.java
+++ b/testsuite/testsuite-infinispan/src/main/java/org/wildfly/swarm/infinispan/test/MyResource.java
@@ -23,7 +23,7 @@ public class MyResource {
     public String get() throws Exception {
         EmbeddedCacheManager cacheContainer
                 = (EmbeddedCacheManager) new InitialContext().lookup("java:jboss/infinispan/container/server");
-        Cache cache = cacheContainer.getCache("server");
+        Cache cache = cacheContainer.getCache("server");
         if (cache.keySet().contains(key)) {
             return (String) cache.get(key);
         }
diff --git a/testsuite/testsuite-infinispan/src/test/java/org/wildfly/swarm/infinispan/test/InfinispanRemoteTest.java b/testsuite/testsuite-infinispan/src/test/java/org/wildfly/swarm/infinispan/test/InfinispanRemoteTest.java
index 09ea443687..2acc670930 100644
--- a/testsuite/testsuite-infinispan/src/test/java/org/wildfly/swarm/infinispan/test/InfinispanRemoteTest.java
+++ b/testsuite/testsuite-infinispan/src/test/java/org/wildfly/swarm/infinispan/test/InfinispanRemoteTest.java
@@ -39,7 +39,7 @@ public class InfinispanRemoteTest {
     public void testBasic() throws Exception {
         CacheContainer cacheContainer =
                 (CacheContainer) new InitialContext().lookup("java:jboss/infinispan/container/server");
-        Cache cache = cacheContainer.getCache("default");
+        Cache cache = cacheContainer.getCache("default");
         cache.put("ham", "biscuit");
         assertEquals("biscuit", cache.get("ham"));
     }
diff --git a/testsuite/testsuite-jaxrs/src/main/java/org/wildfly/swarm/jaxrs/CustomJsonProvider.java b/testsuite/testsuite-jaxrs/src/main/java/org/wildfly/swarm/jaxrs/CustomJsonProvider.java
index a02850627f..5e0815cf86 100644
--- a/testsuite/testsuite-jaxrs/src/main/java/org/wildfly/swarm/jaxrs/CustomJsonProvider.java
+++ b/testsuite/testsuite-jaxrs/src/main/java/org/wildfly/swarm/jaxrs/CustomJsonProvider.java
@@ -42,7 +42,7 @@ public CustomJsonProvider() {
     private ObjectMapper getObjectMapper() {
         ObjectMapper mapper = new ObjectMapper();
         mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
-        mapper.setPropertyNamingStrategy(PropertyNamingStrategy.CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES);
+        mapper.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE);
         return mapper;
     }
 
diff --git a/testsuite/testsuite-jaxrs/src/main/java/org/wildfly/swarm/jaxrs/JsonParsingExceptionResource.java b/testsuite/testsuite-jaxrs/src/main/java/org/wildfly/swarm/jaxrs/JsonParsingExceptionResource.java
index be93a5b876..e780998319 100644
--- a/testsuite/testsuite-jaxrs/src/main/java/org/wildfly/swarm/jaxrs/JsonParsingExceptionResource.java
+++ b/testsuite/testsuite-jaxrs/src/main/java/org/wildfly/swarm/jaxrs/JsonParsingExceptionResource.java
@@ -13,6 +13,7 @@
 @Path("/json")
 public class JsonParsingExceptionResource {
 
+    @SuppressWarnings("deprecation")
     @GET
     @Path("/throw")
     public Response get() throws JsonParseException {
diff --git a/testsuite/testsuite-project-stages/src/test/java/org/wildfly/swarm/StageConfigTest.java b/testsuite/testsuite-project-stages/src/test/java/org/wildfly/swarm/StageConfigTest.java
index 29b5481fea..37d9c3526a 100644
--- a/testsuite/testsuite-project-stages/src/test/java/org/wildfly/swarm/StageConfigTest.java
+++ b/testsuite/testsuite-project-stages/src/test/java/org/wildfly/swarm/StageConfigTest.java
@@ -13,6 +13,7 @@
 /**
  * @author Bob McWhirter
  */
+@SuppressWarnings("deprecation")
 public class StageConfigTest {
 
     @Test
diff --git a/testsuite/testsuite-transactions/src/test/java/org/wildfly/swarm/transactions/test/TransactionsArquillianTest.java b/testsuite/testsuite-transactions/src/test/java/org/wildfly/swarm/transactions/test/TransactionsArquillianTest.java
index 111756ccf2..78ac9a4bea 100644
--- a/testsuite/testsuite-transactions/src/test/java/org/wildfly/swarm/transactions/test/TransactionsArquillianTest.java
+++ b/testsuite/testsuite-transactions/src/test/java/org/wildfly/swarm/transactions/test/TransactionsArquillianTest.java
@@ -39,6 +39,7 @@ public class TransactionsArquillianTest {
     @ArquillianResource
     ServiceRegistry registry;
 
+    @SuppressWarnings("unchecked")
     @Test
     public void testPorts() throws Exception {
         ServiceController statusManagerService = (ServiceController) registry.getService(ServiceName.parse("org.wildfly.network.socket-binding.txn-status-manager"));
diff --git a/tools/src/main/java/org/wildfly/swarm/tools/BuildTool.java b/tools/src/main/java/org/wildfly/swarm/tools/BuildTool.java
index 302910db78..538ed6b1a6 100644
--- a/tools/src/main/java/org/wildfly/swarm/tools/BuildTool.java
+++ b/tools/src/main/java/org/wildfly/swarm/tools/BuildTool.java
@@ -224,8 +224,8 @@ public Archive build() throws Exception {
         addJarManifest();
         addWildFlySwarmApplicationManifest();
         addAdditionalModules();
-        addProjectAsset((ResolvedDependencies) this.dependencyManager);
-        populateUberJarMavenRepository((ResolvedDependencies) this.dependencyManager);
+        addProjectAsset(this.dependencyManager);
+        populateUberJarMavenRepository(this.dependencyManager);
 
         return this.archive;
     }
@@ -245,6 +245,7 @@ private boolean bootstrapJarShadesJBossModules(File artifactFile) throws IOExcep
         return jbossModulesFound;
     }
 
+    @SuppressWarnings("unchecked")
     private void expandArtifact(File artifactFile) throws IOException {
         try {
             ZipFile zipFile = new ZipFile(artifactFile);
@@ -270,6 +271,7 @@ private void analyzeDependencies(boolean autodetect) throws Exception {
         this.dependencyManager.analyzeDependencies(autodetect, declaredDependencies);
     }
 
+    @SuppressWarnings("UnusedParameters")
     private void addProjectAsset(ResolvedDependencies resolvedDependencies) {
         if (this.hollow) {
             return;
@@ -304,7 +306,7 @@ private void detectFractions() throws Exception {
                 .forEach(this::fraction);
     }
 
-    static String strippedSwarmGav(MavenArtifactDescriptor desc) {
+    private static String strippedSwarmGav(MavenArtifactDescriptor desc) {
         if (desc.groupId().equals(DependencyManager.WILDFLY_SWARM_GROUP_ID)) {
             return String.format("%s:%s", desc.artifactId(), desc.version());
         }
@@ -334,7 +336,7 @@ private void addFractions(ResolvedDependencies resolvedDependencies) throws Exce
 
     private void addWildflySwarmBootstrapJar() throws Exception {
 
-        ResolvedDependencies resolvedDependencies = (ResolvedDependencies) this.dependencyManager;
+        ResolvedDependencies resolvedDependencies = this.dependencyManager;
 
         ArtifactSpec artifact = resolvedDependencies.findWildFlySwarmBootstrapJar();
 
@@ -478,7 +480,7 @@ private void populateUberJarMavenRepository(Archive archive, ResolvedDependencie
 
             if (unresolved || !exploded) {
                 toBeResolved.add(dependency);
-            } else if (!unresolved) {
+            } else {
                 alreadyResolved.add(dependency);
             }
         }
@@ -510,12 +512,12 @@ private void populateUserMavenRepository(ResolvedDependencies resolvedDependenci
 
         toBeResolved.addAll(
                 resolvedDependencies.getDependencies().stream()
-                        .filter(a -> a.isResolved() == false)
+                        .filter(a -> !a.isResolved())
                         .collect(Collectors.toList())
         );
         toBeResolved.addAll(
                 resolvedDependencies.getModuleDependencies().stream()
-                        .filter(a -> a.isResolved() == false)
+                        .filter(a -> !a.isResolved())
                         .collect(Collectors.toList())
         );
 
@@ -571,7 +573,7 @@ private void addArtifactToArchiveMavenRepository(Archive archive, ArtifactSpec a
 
     private final DefaultArtifactResolver resolver;
 
-    public static final SimpleLogger STD_LOGGER = new SimpleLogger() {
+    private static final SimpleLogger STD_LOGGER = new SimpleLogger() {
         @Override
         public void info(String msg) {
             System.out.println(msg);
diff --git a/tools/src/main/java/org/wildfly/swarm/tools/DependencyManager.java b/tools/src/main/java/org/wildfly/swarm/tools/DependencyManager.java
index 3f722d91d9..a5b5e43242 100644
--- a/tools/src/main/java/org/wildfly/swarm/tools/DependencyManager.java
+++ b/tools/src/main/java/org/wildfly/swarm/tools/DependencyManager.java
@@ -180,7 +180,7 @@ private void resolveDependencies(DeclaredDependencies declaredDependencies, bool
                     .filter(dep -> dep.type().equals(JAR))
                     .collect(Collectors.toList());
 
-            Collection resolvedTransientDependencies = Collections.EMPTY_SET;
+            Collection resolvedTransientDependencies = Collections.emptySet();
             if (filtered.size() > 0) {
 
                 resolvedTransientDependencies = resolver.resolveAllArtifactsNonTransitively(filtered);