Author: struberg
Date: Sun Mar 25 21:32:37 2012
New Revision: 1305147
URL: http://svn.apache.org/viewvc?rev=1305147&view=rev
Log:
OWB-657 remove unused method and improve keySet iterators
Modified:
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/AnnotationUtil.java
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
Modified:
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/AnnotationUtil.java
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/AnnotationUtil.java?rev=1305147&r1=1305146&r2=1305147&view=diff
==============================================================================
---
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/AnnotationUtil.java
(original)
+++
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/AnnotationUtil.java
Sun Mar 25 21:32:37 2012
@@ -156,41 +156,6 @@ public final class AnnotationUtil
return false;
}
-
-
- public static Type[]
getMethodParameterGenericTypesWithGivenAnnotation(Method method, Class<?
extends Annotation> clazz)
- {
- Asserts.assertNotNull(method, "Method argument can not be null");
- Asserts.nullCheckForClass(clazz);
-
- List<Type> list = new ArrayList<Type>();
- Type[] result;
-
- Annotation[][] parameterAnns = method.getParameterAnnotations();
- Type[] genericTypes = method.getGenericParameterTypes();
-
- int i = 0;
- for (Annotation[] parameters : parameterAnns)
- {
- for (Annotation param : parameters)
- {
- Class<? extends Annotation> btype = param.annotationType();
- if (btype.equals(clazz))
- {
- list.add(genericTypes[i]);
- break;
- }
- }
-
- i++;
-
- }
-
- result = new Type[list.size()];
- result = list.toArray(result);
-
- return result;
- }
/**
* Check given annotation exist in the multiple parameter of the given
@@ -586,7 +551,6 @@ public final class AnnotationUtil
* which are not annotated with @Nonbinding.
*
* @param qualifierAnnotationType
- * @return a {@link RandomAccess} List instance
*/
private static List<Method> getBindingQualifierMethods(
Class<? extends Annotation> qualifierAnnotationType)
Modified:
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java?rev=1305147&r1=1305146&r2=1305147&view=diff
==============================================================================
---
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
(original)
+++
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
Sun Mar 25 21:32:37 2012
@@ -2207,9 +2207,10 @@ public final class WebBeansUtil
WebBeansContext webBeansContext = this.webBeansContext;
AnnotationManager annotationManager =
webBeansContext.getAnnotationManager();
- for(ProducerMethodBean<?> bean : annotatedMethods.keySet())
+ for(Map.Entry<ProducerMethodBean<?>, AnnotatedMethod<?>> beanEntry :
annotatedMethods.entrySet())
{
- AnnotatedMethod<?> annotatedMethod = annotatedMethods.get(bean);
+ ProducerMethodBean<?> bean = beanEntry.getKey();
+ AnnotatedMethod<?> annotatedMethod = beanEntry.getValue();
Annotation[] annotationsFromSet =
AnnotationUtil.getAnnotationsFromSet(bean.getQualifiers());
Method disposal =
annotationManager.getDisposalWithGivenAnnotatedMethod(annotatedType,
bean.getReturnType(), annotationsFromSet);
@@ -2234,9 +2235,10 @@ public final class WebBeansUtil
public void
fireProcessObservableMethodBeanEvent(Map<ObserverMethod<?>,AnnotatedMethod<?>>
annotatedMethods)
{
- for(ObserverMethod<?> observableMethod : annotatedMethods.keySet())
+ for(Map.Entry<ObserverMethod<?>, AnnotatedMethod<?>>
observableMethodEntry : annotatedMethods.entrySet())
{
- AnnotatedMethod<?> annotatedMethod =
annotatedMethods.get(observableMethod);
+ ObserverMethod<?> observableMethod =
observableMethodEntry.getKey();
+ AnnotatedMethod<?> annotatedMethod =
observableMethodEntry.getValue();
GProcessObservableMethod event = new
GProcessObservableMethod(annotatedMethod, observableMethod);
@@ -2248,9 +2250,10 @@ public final class WebBeansUtil
public void
fireProcessProducerFieldBeanEvent(Map<ProducerFieldBean<?>,AnnotatedField<?>>
annotatedFields)
{
- for(ProducerFieldBean<?> bean : annotatedFields.keySet())
+ for(Map.Entry<ProducerFieldBean<?>, AnnotatedField<?>> beanEntry :
annotatedFields.entrySet())
{
- AnnotatedField<?> field = annotatedFields.get(bean);
+ ProducerFieldBean<?> bean = beanEntry.getKey();
+ AnnotatedField<?> field = beanEntry.getValue();
GProcessProducerField processProducerFieldEvent = new
GProcessProducerField(bean,field);