deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject git commit: warnings/spelling/whitespace/misc. cleanups
Date Wed, 15 Oct 2014 17:45:28 GMT
Repository: deltaspike
Updated Branches:
  refs/heads/master 3b169675e -> 5745b0a64


warnings/spelling/whitespace/misc. cleanups


Project: http://git-wip-us.apache.org/repos/asf/deltaspike/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltaspike/commit/5745b0a6
Tree: http://git-wip-us.apache.org/repos/asf/deltaspike/tree/5745b0a6
Diff: http://git-wip-us.apache.org/repos/asf/deltaspike/diff/5745b0a6

Branch: refs/heads/master
Commit: 5745b0a6431d57647632356edbaafdc583006251
Parents: 3b16967
Author: mbenson <mbenson@apache.org>
Authored: Tue Oct 14 17:28:20 2014 -0500
Committer: Matt Benson <mbenson@apache.org>
Committed: Wed Oct 15 10:27:02 2014 -0500

----------------------------------------------------------------------
 .../core/api/config/ConfigResolver.java         | 13 ++---
 .../core/api/config/PropertyLoader.java         |  5 +-
 .../core/api/config/view/ViewRef.java           |  6 +--
 .../view/controller/ViewControllerRef.java      |  4 +-
 .../view/metadata/CallbackDescriptor.java       | 22 ++++-----
 .../config/view/metadata/ConfigDescriptor.java  |  4 ++
 .../metadata/ExecutableCallbackDescriptor.java  |  5 +-
 .../view/metadata/InlineViewMetaData.java       |  3 +-
 .../view/metadata/SimpleCallbackDescriptor.java |  4 +-
 .../view/metadata/ViewConfigResolver.java       |  2 +-
 .../api/config/view/metadata/ViewMetaData.java  |  1 +
 .../deltaspike/core/api/exclude/Exclude.java    |  1 +
 .../core/api/provider/BeanManagerProvider.java  | 17 +++----
 .../core/api/provider/BeanProvider.java         | 50 ++++++++++----------
 .../core/api/provider/DependentProvider.java    |  2 +
 15 files changed, 67 insertions(+), 72 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/5745b0a6/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/ConfigResolver.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/ConfigResolver.java
b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/ConfigResolver.java
index a44d4b8..80ea0a5 100644
--- a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/ConfigResolver.java
+++ b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/ConfigResolver.java
@@ -111,7 +111,6 @@ public final class ConfigResolver
      */
     public static void addConfigFilter(ConfigFilter configFilter)
     {
-
         List<ConfigFilter> currentConfigFilters = getConfigFilters();
         currentConfigFilters.add(configFilter);
     }
@@ -302,14 +301,12 @@ public final class ConfigResolver
      */
     public static List<String> getAllPropertyValues(String key)
     {
-        List<ConfigSource> appConfigSources =
-                sortAscending(new ArrayList<ConfigSource>(Arrays.asList(getConfigSources())));
+        List<ConfigSource> appConfigSources = sortAscending(Arrays.<ConfigSource>
asList(getConfigSources()));
         List<String> result = new ArrayList<String>();
 
-        String value;
         for (ConfigSource configSource : appConfigSources)
         {
-            value = configSource.getPropertyValue(key);
+            String value = configSource.getPropertyValue(key);
 
             if (value != null)
             {
@@ -326,8 +323,7 @@ public final class ConfigResolver
 
     public static Map<String, String> getAllProperties()
     {
-        List<ConfigSource> appConfigSources =
-                sortAscending(new ArrayList<ConfigSource>(Arrays.asList(getConfigSources())));
+        List<ConfigSource> appConfigSources = sortAscending(Arrays.<ConfigSource>
asList(getConfigSources()));
         Map<String, String> result = new HashMap<String, String>();
 
         for (ConfigSource configSource : appConfigSources)
@@ -428,7 +424,7 @@ public final class ConfigResolver
 
     private static String fallbackToDefaultIfEmpty(String key, String value, String defaultValue)
     {
-        if (value == null || value.length() == 0)
+        if (value == null || value.isEmpty())
         {
             LOG.log(Level.FINE, "no configured value found for key {0}, using default value
{1}.",
                     new Object[]{key, defaultValue});
@@ -465,5 +461,4 @@ public final class ConfigResolver
         return logValue;
     }
 
-
 }

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/5745b0a6/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/PropertyLoader.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/PropertyLoader.java
b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/PropertyLoader.java
index 32590e9..ecd7291 100644
--- a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/PropertyLoader.java
+++ b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/PropertyLoader.java
@@ -244,12 +244,12 @@ public class PropertyLoader
         Properties mergedProperties = new Properties();
         for (Properties p : sortedProperties)
         {
-            for (Map.Entry<?,?> entry : p.entrySet())
+            for (Map.Entry<?, ?> entry : p.entrySet())
             {
                 String key = (String) entry.getKey();
                 String value = (String) entry.getValue();
 
-                if (!key.equals(ConfigSource.DELTASPIKE_ORDINAL))
+                if (!ConfigSource.DELTASPIKE_ORDINAL.equals(key))
                 {
                     // simply overwrite the old properties with the new ones.
                     mergedProperties.setProperty(key, value);
@@ -260,5 +260,4 @@ public class PropertyLoader
         return mergedProperties;
     }
 
-
 }

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/5745b0a6/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/view/ViewRef.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/view/ViewRef.java
b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/view/ViewRef.java
index 0ced532..b6abf6c 100644
--- a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/view/ViewRef.java
+++ b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/view/ViewRef.java
@@ -72,14 +72,10 @@ public @interface ViewRef
         @Override
         public ViewControllerRef convertToViewMetaData(ViewRef inlineMetaData, Class<?>
sourceClass)
         {
-            String beanName = null;
 
             Named named = sourceClass.getAnnotation(Named.class);
 
-            if (named != null)
-            {
-                beanName = named.value();
-            }
+            String beanName = named == null ? null : named.value();
 
             return new ViewControllerRefLiteral(sourceClass, beanName);
         }

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/5745b0a6/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/view/controller/ViewControllerRef.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/view/controller/ViewControllerRef.java
b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/view/controller/ViewControllerRef.java
index 68d3f53..e107db1 100644
--- a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/view/controller/ViewControllerRef.java
+++ b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/view/controller/ViewControllerRef.java
@@ -49,7 +49,7 @@ public @interface ViewControllerRef
      *
      * @return class of the page-bean
      */
-    Class value();
+    Class<?> value();
 
     /**
      * Currently not implemented
@@ -82,7 +82,7 @@ public @interface ViewControllerRef
     //not needed outside
     static class Descriptor extends SimpleCallbackDescriptor<Void>
     {
-        protected Descriptor(Class beanClass, Class<? extends Annotation> callbackType)
+        protected Descriptor(Class<?> beanClass, Class<? extends Annotation>
callbackType)
         {
             super(beanClass, callbackType);
         }

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/5745b0a6/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/view/metadata/CallbackDescriptor.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/view/metadata/CallbackDescriptor.java
b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/view/metadata/CallbackDescriptor.java
index 5cc9695..cb7e1c8 100644
--- a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/view/metadata/CallbackDescriptor.java
+++ b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/view/metadata/CallbackDescriptor.java
@@ -39,17 +39,17 @@ public abstract class CallbackDescriptor
     protected List<CallbackEntry> callbacks = new ArrayList<CallbackEntry>();
     protected Class<? extends Annotation> callbackType;
 
-    protected CallbackDescriptor(Class beanClass, Class<? extends Annotation> callbackMarker)
+    protected CallbackDescriptor(Class<?> beanClass, Class<? extends Annotation>
callbackMarker)
     {
         init(new Class[]{beanClass}, callbackMarker);
     }
 
-    protected CallbackDescriptor(Class[] beanClasses, Class<? extends Annotation> callbackMarker)
+    protected CallbackDescriptor(Class<?>[] beanClasses, Class<? extends Annotation>
callbackMarker)
     {
         init(beanClasses, callbackMarker);
     }
 
-    protected void init(Class[] targetBeanClasses, Class<? extends Annotation> callbackMarker)
+    protected void init(Class<?>[] targetBeanClasses, Class<? extends Annotation>
callbackMarker)
     {
         if (callbackMarker == null)
         {
@@ -59,7 +59,7 @@ public abstract class CallbackDescriptor
         this.callbackType = callbackMarker;
 
         //TODO discuss how deep we should scan
-        for (Class targetBeanClass : targetBeanClasses)
+        for (Class<?> targetBeanClass : targetBeanClasses)
         {
             CallbackEntry callbackEntry = new CallbackEntry(targetBeanClass, callbackMarker);
             if (!callbackEntry.callbackMethods.isEmpty())
@@ -69,9 +69,9 @@ public abstract class CallbackDescriptor
         }
     }
 
-    public Map<Class, List<Method>> getCallbackMethods()
+    public Map<Class<?>, List<Method>> getCallbackMethods()
     {
-        Map<Class, List<Method>> result = new HashMap<Class, List<Method>>(this.callbacks.size());
+        Map<Class<?>, List<Method>> result = new HashMap<Class<?>,
List<Method>>(this.callbacks.size());
 
         for (CallbackEntry callbackEntry : this.callbacks)
         {
@@ -80,7 +80,7 @@ public abstract class CallbackDescriptor
         return result;
     }
 
-    protected Object getTargetObject(Class targetType)
+    protected <T> T getTargetObject(Class<T> targetType)
     {
         return BeanProvider.getContextualReference(targetType, true);
     }
@@ -101,7 +101,7 @@ public abstract class CallbackDescriptor
         private final Class<?> targetBeanClass;
         private final String beanName;
 
-        private CallbackEntry(Class beanClass, Class<? extends Annotation> callbackMarker)
+        private CallbackEntry(Class<?> beanClass, Class<? extends Annotation>
callbackMarker)
         {
             this.targetBeanClass = beanClass;
 
@@ -123,10 +123,10 @@ public abstract class CallbackDescriptor
         }
 
         private void findMethodWithCallbackMarker(Class<? extends Annotation> callbackMarker,
-                                                  Class classToAnalyze,
+                                                  Class<?> classToAnalyze,
                                                   List<String> processedMethodNames)
         {
-            Class currentClass = classToAnalyze;
+            Class<?> currentClass = classToAnalyze;
 
             while (currentClass != null && !Object.class.getName().equals(currentClass.getName()))
             {
@@ -156,7 +156,7 @@ public abstract class CallbackDescriptor
                 }
 
                 //scan interfaces
-                for (Class interfaceClass : currentClass.getInterfaces())
+                for (Class<?> interfaceClass : currentClass.getInterfaces())
                 {
                     findMethodWithCallbackMarker(callbackMarker, interfaceClass, processedMethodNames);
                 }

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/5745b0a6/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/view/metadata/ConfigDescriptor.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/view/metadata/ConfigDescriptor.java
b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/view/metadata/ConfigDescriptor.java
index 50877ae..df4383b 100644
--- a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/view/metadata/ConfigDescriptor.java
+++ b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/view/metadata/ConfigDescriptor.java
@@ -68,6 +68,8 @@ public interface ConfigDescriptor<CT /*config type*/>
      * @param executorType type of the executor which allows to get a typed result (e.g.
Secured.Descriptor)
      * @return descriptor for the callback which also allows to invoke it or null if there
is no callback-method
      */
+    @SuppressWarnings("rawtypes")
+    //TODO <T extends ExecutableCallbackDescriptor<?>> when major version is
incremented
     <T extends ExecutableCallbackDescriptor> T getExecutableCallbackDescriptor(Class<?
extends Annotation> metaDataType,
                                                                                Class<?
extends T> executorType);
 
@@ -78,6 +80,8 @@ public interface ConfigDescriptor<CT /*config type*/>
      * @param executorType type of the executor which allows to get a typed result (e.g.
Secured.Descriptor)
      * @return descriptor for the callback which also allows to invoke it or null if there
is no callback-method
      */
+    @SuppressWarnings("rawtypes")
+    //TODO <T extends ExecutableCallbackDescriptor<?>> when major version is
incremented
     <T extends ExecutableCallbackDescriptor> T getExecutableCallbackDescriptor(Class<?
extends Annotation> metaDataType,
                                                                                Class<?
extends Annotation> callbackType,
                                                                                Class<?
extends T> executorType);

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/5745b0a6/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/view/metadata/ExecutableCallbackDescriptor.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/view/metadata/ExecutableCallbackDescriptor.java
b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/view/metadata/ExecutableCallbackDescriptor.java
index c8979f6..16c80b5 100644
--- a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/view/metadata/ExecutableCallbackDescriptor.java
+++ b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/view/metadata/ExecutableCallbackDescriptor.java
@@ -34,12 +34,12 @@ import java.util.List;
  */
 public abstract class ExecutableCallbackDescriptor<R> extends CallbackDescriptor
 {
-    protected ExecutableCallbackDescriptor(Class beanClass, Class<? extends Annotation>
callbackMarker)
+    protected ExecutableCallbackDescriptor(Class<?> beanClass, Class<? extends Annotation>
callbackMarker)
     {
         super(beanClass, callbackMarker);
     }
 
-    protected ExecutableCallbackDescriptor(Class[] beanClasses, Class<? extends Annotation>
callbackMarker)
+    protected ExecutableCallbackDescriptor(Class<?>[] beanClasses, Class<? extends
Annotation> callbackMarker)
     {
         super(beanClasses, callbackMarker);
     }
@@ -68,6 +68,7 @@ public abstract class ExecutableCallbackDescriptor<R> extends CallbackDescriptor
                         }
                     }
 
+                    @SuppressWarnings("unchecked")
                     R result = (R) callbackMethod.invoke(bean, parameters);
 
                     if (result != null)

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/5745b0a6/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/view/metadata/InlineViewMetaData.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/view/metadata/InlineViewMetaData.java
b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/view/metadata/InlineViewMetaData.java
index 37137af..15e07ba 100644
--- a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/view/metadata/InlineViewMetaData.java
+++ b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/view/metadata/InlineViewMetaData.java
@@ -34,7 +34,8 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
 
 public @interface InlineViewMetaData
 {
-    Class<? extends TargetViewConfigProvider> targetViewConfigProvider();
+    Class<? extends TargetViewConfigProvider<?>> targetViewConfigProvider();
 
+    @SuppressWarnings("rawtypes")
     Class<? extends InlineMetaDataTransformer> inlineMetaDataTransformer() default
InlineMetaDataTransformer.class;
 }

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/5745b0a6/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/view/metadata/SimpleCallbackDescriptor.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/view/metadata/SimpleCallbackDescriptor.java
b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/view/metadata/SimpleCallbackDescriptor.java
index ae27c13..81b828e 100644
--- a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/view/metadata/SimpleCallbackDescriptor.java
+++ b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/view/metadata/SimpleCallbackDescriptor.java
@@ -29,12 +29,12 @@ import java.util.List;
  */
 public abstract class SimpleCallbackDescriptor<R> extends ExecutableCallbackDescriptor<R>
 {
-    protected SimpleCallbackDescriptor(Class beanClass, Class<? extends Annotation>
callbackMarker)
+    protected SimpleCallbackDescriptor(Class<?> beanClass, Class<? extends Annotation>
callbackMarker)
     {
         super(beanClass, callbackMarker);
     }
 
-    protected SimpleCallbackDescriptor(Class[] beanClasses, Class<? extends Annotation>
callbackMarker)
+    protected SimpleCallbackDescriptor(Class<?>[] beanClasses, Class<? extends Annotation>
callbackMarker)
     {
         super(beanClasses, callbackMarker);
     }

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/5745b0a6/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/view/metadata/ViewConfigResolver.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/view/metadata/ViewConfigResolver.java
b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/view/metadata/ViewConfigResolver.java
index 1071cf7..82d2de7 100644
--- a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/view/metadata/ViewConfigResolver.java
+++ b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/view/metadata/ViewConfigResolver.java
@@ -42,7 +42,7 @@ public interface ViewConfigResolver
      * @param configClass config-class (which usually represents a folder node)
      * @return config-descriptor which represents the given config-class
      */
-    ConfigDescriptor<?> getConfigDescriptor(Class configClass);
+    ConfigDescriptor<?> getConfigDescriptor(Class<?> configClass);
 
     //TODO re-visit name (depends on other discussions)
     /**

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/5745b0a6/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/view/metadata/ViewMetaData.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/view/metadata/ViewMetaData.java
b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/view/metadata/ViewMetaData.java
index 9844a79..095d5f8 100644
--- a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/view/metadata/ViewMetaData.java
+++ b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/view/metadata/ViewMetaData.java
@@ -39,5 +39,6 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
 @Aggregated(false)
 public @interface ViewMetaData
 {
+    @SuppressWarnings("rawtypes")
     Class<? extends ConfigPreProcessor> preProcessor() default ConfigPreProcessor.class;
 }

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/5745b0a6/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/exclude/Exclude.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/exclude/Exclude.java
b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/exclude/Exclude.java
index c41d251..1e2cc0a 100644
--- a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/exclude/Exclude.java
+++ b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/exclude/Exclude.java
@@ -101,5 +101,6 @@ public @interface Exclude
     /**
      * @return class of the interpreter which should be used (default leads to a simple config-property
interpreter)
      */
+    @SuppressWarnings("rawtypes")
     Class<? extends ExpressionInterpreter> interpretedBy() default ExpressionInterpreter.class;
 }

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/5745b0a6/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/provider/BeanManagerProvider.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/provider/BeanManagerProvider.java
b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/provider/BeanManagerProvider.java
index 5f2e4f5..02a3972 100644
--- a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/provider/BeanManagerProvider.java
+++ b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/provider/BeanManagerProvider.java
@@ -60,7 +60,7 @@ public class BeanManagerProvider implements Extension
 {
     private static final Logger  LOG = Logger.getLogger(BeanManagerProvider.class.getName());
 
-    private static BeanManagerProvider bmpSingleton = null;
+    private static BeanManagerProvider bmpSingleton;
 
     /**
      * This data container is used for storing the BeanManager for each
@@ -72,21 +72,21 @@ public class BeanManagerProvider implements Extension
         /**
          * The BeanManager picked up via Extension loading
          */
-        private BeanManager loadTimeBm = null;
+        private BeanManager loadTimeBm;
 
         /**
          * The final BeanManagers.
          * After the container did finally boot, we first try to resolve them from JNDI,
          * and only if we don't find any BM there we take the ones picked up at startup.
          */
-        private BeanManager finalBm = null;
+        private BeanManager finalBm;
 
         /**
          * Whether the CDI Application has finally booted.
          * Please note that this is only a nearby value
          * as there is no reliable event for this status in EE6.
          */
-        private boolean booted = false;
+        private boolean booted;
     }
 
     /**
@@ -150,7 +150,7 @@ public class BeanManagerProvider implements Extension
         setBeanManagerProvider(this);
 
         BeanManagerInfo bmi = getBeanManagerInfo(ClassUtils.getClassLoader(null));
-        bmi.loadTimeBm =  beanManager;
+        bmi.loadTimeBm = beanManager;
     }
 
     /**
@@ -253,8 +253,7 @@ public class BeanManagerProvider implements Extension
             return;
         }
 
-        ClassLoader classLoader = ClassUtils.getClassLoader(null);
-        bmpSingleton.bmInfos.remove(classLoader);
+        bmpSingleton.bmInfos.remove(ClassUtils.getClassLoader(null));
     }
 
     /**
@@ -326,8 +325,7 @@ public class BeanManagerProvider implements Extension
      */
     private boolean isParentBeanManagerBooted()
     {
-        ClassLoader classLoader = ClassUtils.getClassLoader(null);
-        BeanManagerInfo parentBmi = getParentBeanManagerInfo(classLoader);
+        BeanManagerInfo parentBmi = getParentBeanManagerInfo(ClassUtils.getClassLoader(null));
 
         return parentBmi != null && parentBmi.booted;
     }
@@ -355,5 +353,4 @@ public class BeanManagerProvider implements Extension
         return bmi;
     }
 
-
 }

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/5745b0a6/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/provider/BeanProvider.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/provider/BeanProvider.java
b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/provider/BeanProvider.java
index daea20b..12a6ca1 100644
--- a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/provider/BeanProvider.java
+++ b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/provider/BeanProvider.java
@@ -29,13 +29,12 @@ import javax.enterprise.inject.spi.AnnotatedType;
 import javax.enterprise.inject.spi.Bean;
 import javax.enterprise.inject.spi.BeanManager;
 import javax.enterprise.inject.spi.InjectionTarget;
+
 import java.lang.annotation.Annotation;
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Collection;
 import java.util.Collections;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
 import java.util.logging.Level;
@@ -60,11 +59,9 @@ public final class BeanProvider
 {
     private static final Logger LOG = Logger.getLogger(BeanProvider.class.getName());
 
-    private static final boolean LOG_DEPENDENT_WARNINGS;
-    static {
-        ProjectStage ps = ProjectStageProducer.getInstance().getProjectStage();
-        LOG_DEPENDENT_WARNINGS = ps.equals(ProjectStage.Development) || ps.equals(ProjectStage.UnitTest);
-    }
+    private static final boolean LOG_DEPENDENT_WARNINGS =
+            Arrays.asList(ProjectStage.Development, ProjectStage.UnitTest).contains(
+                    ProjectStageProducer.getInstance().getProjectStage());
 
     private BeanProvider()
     {
@@ -107,7 +104,7 @@ public final class BeanProvider
      * @param type the type of the bean in question
      * @param optional if <code>true</code> it will return <code>null</code>
if no bean could be found or created.
      *                 Otherwise it will throw an {@code IllegalStateException}
-     * @param qualifiers additional qualifiers which further distinct the resolved bean
+     * @param qualifiers additional qualifiers which further distinguish the resolved bean
      * @param <T> target type
      * @return the resolved Contextual Reference
      * @see #getContextualReference(Class, Annotation...)
@@ -122,13 +119,13 @@ public final class BeanProvider
     /**
      * {@link #getContextualReference(Class, Annotation...)} which returns <code>null</code>
if the
      * 'optional' parameter is set to <code>true</code>.
-     * This method is intended for usage where the BeanManger is known, e.g. in Extensions.
+     * This method is intended for usage where the BeanManager is known, e.g. in Extensions.
      *
      * @param beanManager the BeanManager to use
      * @param type the type of the bean in question
      * @param optional if <code>true</code> it will return <code>null</code>
if no bean could be found or created.
      *                 Otherwise it will throw an {@code IllegalStateException}
-     * @param qualifiers additional qualifiers which further distinct the resolved bean
+     * @param qualifiers additional qualifiers which further distinguish the resolved bean
      * @param <T> target type
      * @return the resolved Contextual Reference
      * @see #getContextualReference(Class, Annotation...)
@@ -239,7 +236,7 @@ public final class BeanProvider
     private static <T> T getContextualReference(Class<T> type, BeanManager beanManager,
Bean<?> bean)
     {
         //noinspection unchecked
-        return getContextualReference(type, beanManager, new HashSet<Bean<?>>((Collection)
Arrays.asList(bean)));
+        return getContextualReference(type, beanManager, Collections.<Bean<?>>
singleton(bean));
     }
 
     /**
@@ -306,24 +303,28 @@ public final class BeanProvider
     {
         BeanManager beanManager = getBeanManager();
         Set<Bean<?>> beans = beanManager.getBeans(type, qualifiers);
-        Bean<?> bean = beanManager.resolve(beans);
-        return createDependentProvider(beanManager, type, (Bean<T>) bean);
+        @SuppressWarnings("unchecked")
+        Bean<T> bean = (Bean<T>) beanManager.resolve(beans);
+        return createDependentProvider(beanManager, type, bean);
     }
 
     public static <T> DependentProvider<T> getDependent(String name)
     {
         BeanManager beanManager = getBeanManager();
         Set<Bean<?>> beans = beanManager.getBeans(name);
-        Bean<?> bean = beanManager.resolve(beans);
-        Class beanClass = bean.getBeanClass();
+        @SuppressWarnings("unchecked")
+        Bean<T> bean = (Bean<T>) beanManager.resolve(beans);
+        @SuppressWarnings("unchecked")
+        Class<T> beanClass = (Class<T>) bean.getBeanClass();
 
-        return createDependentProvider(beanManager, (Class<T>) beanClass, (Bean<T>)
bean);
+        return createDependentProvider(beanManager, beanClass, bean);
     }
 
     private static <T> DependentProvider<T> createDependentProvider(BeanManager
beanManager, Class<T> type,
                                                                     Bean<T> bean)
     {
         CreationalContext<T> cc = beanManager.createCreationalContext(bean);
+        @SuppressWarnings("unchecked")
         T instance = (T) beanManager.getReference(bean, type, cc);
 
         return new DependentProvider<T>(bean, cc, instance);
@@ -375,7 +376,9 @@ public final class BeanProvider
         for (Bean<?> bean : beans)
         {
             //noinspection unchecked
-            result.add((Bean<T>) bean);
+            @SuppressWarnings("unchecked")
+            Bean<T> beanT = (Bean<T>) bean;
+            result.add(beanT);
         }
         
         return result;
@@ -401,10 +404,10 @@ public final class BeanProvider
 
         BeanManager beanManager = getBeanManager();
 
-        CreationalContext creationalContext = beanManager.createCreationalContext(null);
+        CreationalContext<T> creationalContext = beanManager.createCreationalContext(null);
 
-        AnnotatedType annotatedType = beanManager.createAnnotatedType(instance.getClass());
-        InjectionTarget injectionTarget = beanManager.createInjectionTarget(annotatedType);
+        AnnotatedType<T> annotatedType = beanManager.createAnnotatedType((Class<T>)
instance.getClass());
+        InjectionTarget<T> injectionTarget = beanManager.createInjectionTarget(annotatedType);
         injectionTarget.inject(instance, creationalContext);
         return instance;
     }
@@ -413,13 +416,8 @@ public final class BeanProvider
     {
         Set<Bean<?>> result = new HashSet<Bean<?>>(beans.size());
 
-        Iterator<Bean<?>> beanIterator = beans.iterator();
-
-        Bean<?> currentBean;
-        while (beanIterator.hasNext())
+        for (Bean<?> currentBean : beans)
         {
-            currentBean = beanIterator.next();
-
             if (!Dependent.class.isAssignableFrom(currentBean.getScope()))
             {
                 result.add(currentBean);

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/5745b0a6/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/provider/DependentProvider.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/provider/DependentProvider.java
b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/provider/DependentProvider.java
index 3b71678..8e72653 100644
--- a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/provider/DependentProvider.java
+++ b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/provider/DependentProvider.java
@@ -22,6 +22,7 @@ import javax.enterprise.context.spi.CreationalContext;
 import javax.enterprise.inject.spi.Bean;
 import javax.enterprise.inject.spi.PassivationCapable;
 import javax.inject.Provider;
+
 import java.io.IOException;
 import java.io.NotSerializableException;
 import java.io.ObjectInputStream;
@@ -90,6 +91,7 @@ public class DependentProvider<T> implements Provider<T>, Serializable
         out.writeObject(creationalContext);
     }
 
+    @SuppressWarnings("unchecked")
     private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
     {
         long oldSerialId = in.readLong();


Mime
View raw message