Author: struberg
Date: Sat Mar 31 15:48:16 2012
New Revision: 1307837
URL: http://svn.apache.org/viewvc?rev=1307837&view=rev
Log:
cleanup issues found by sonar
Modified:
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java
Modified:
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java?rev=1307837&r1=1307836&r2=1307837&view=diff
==============================================================================
---
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java
(original)
+++
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java
Sat Mar 31 15:48:16 2012
@@ -103,8 +103,6 @@ public final class DefinitionUtil
*/
public static <T> void defineApiTypes(AbstractOwbBean<T> bean, Class<T>
clazz)
{
- Annotation[] annots = clazz.getDeclaredAnnotations();
-
//Looking for bean types
Typed beanTypes = clazz.getAnnotation(Typed.class);
if(beanTypes != null)
@@ -757,7 +755,6 @@ public final class DefinitionUtil
Annotation[] methodAnns = method.getDeclaredAnnotations();
- WebBeansContext webBeansContext = parent.getWebBeansContext();
webBeansContext.getWebBeansUtil().setBeanEnableFlagForProducerBean(parent,
component, methodAnns);
defineProducerMethodApiTypes(component, method.getGenericReturnType(),
methodAnns);
@@ -867,7 +864,7 @@ public final class DefinitionUtil
Bean<?> bean = set.iterator().next();
ProducerMethodBean<?> pr = null;
- if (bean == null || !(bean instanceof ProducerMethodBean))
+ if (!(bean instanceof ProducerMethodBean))
{
throwUnsatisfiedResolutionException(clazz, declaredMethod);
}
@@ -1287,6 +1284,7 @@ public final class DefinitionUtil
private <X> void
createProducerBeansFromAnnotatedType(InjectionTargetBean<X> bean,
Set<ProducerMethodBean<?>> producerComponents,
AnnotatedMethod<X>
annotatedMethod, Class<?> clazz, boolean isSpecializes)
{
+ boolean specializes = isSpecializes;
Set<Annotation> annSet = annotatedMethod.getAnnotations();
if (annSet == null || annSet.isEmpty())
{
@@ -1322,11 +1320,11 @@ public final class DefinitionUtil
+ " can not be
static");
}
- isSpecializes = true;
+ specializes = true;
}
ProducerMethodBean<?> newComponent =
createProducerBeanFromAnnotatedType((Class<X>)annotatedMethod.getJavaMember().getReturnType(),
-
annotatedMethod, bean, isSpecializes);
+
annotatedMethod, bean, specializes);
if (newComponent != null)
{
producerComponents.add(newComponent);