myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tandrasc...@apache.org
Subject [myfaces] branch master updated: refactored CDI utils
Date Sun, 14 Jul 2019 19:44:24 GMT
This is an automated email from the ASF dual-hosted git repository.

tandraschko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces.git


The following commit(s) were added to refs/heads/master by this push:
     new d0d48aa  refactored CDI utils
d0d48aa is described below

commit d0d48aab7891999e4a10265a73b5f5e3d9459a77
Author: Thomas Andraschko <tandraschko@apache.org>
AuthorDate: Sun Jul 14 21:43:14 2019 +0200

    refactored CDI utils
---
 .../org/apache/myfaces/cdi/behavior/FacesBehaviorExtension.java    | 5 +----
 .../org/apache/myfaces/cdi/converter/FacesConverterExtension.java  | 7 ++-----
 .../java/org/apache/myfaces/cdi/model/FacesDataModelExtension.java | 5 +----
 .../org/apache/myfaces/cdi/validator/FacesValidatorExtension.java  | 5 +----
 4 files changed, 5 insertions(+), 17 deletions(-)

diff --git a/impl/src/main/java/org/apache/myfaces/cdi/behavior/FacesBehaviorExtension.java
b/impl/src/main/java/org/apache/myfaces/cdi/behavior/FacesBehaviorExtension.java
index 6f59cb3..a90abc2 100644
--- a/impl/src/main/java/org/apache/myfaces/cdi/behavior/FacesBehaviorExtension.java
+++ b/impl/src/main/java/org/apache/myfaces/cdi/behavior/FacesBehaviorExtension.java
@@ -19,7 +19,6 @@
 
 package org.apache.myfaces.cdi.behavior;
 
-import java.lang.reflect.Type;
 import java.util.HashSet;
 import java.util.Set;
 import javax.enterprise.event.Observes;
@@ -40,15 +39,13 @@ public class FacesBehaviorExtension implements Extension
         Annotated annotated = event.getAnnotatedBeanClass();
         if (annotated.isAnnotationPresent(FacesBehavior.class))
         {
-            Type type = annotated.getBaseType();
-
             FacesBehavior behavior = (FacesBehavior) annotated.getAnnotation(FacesBehavior.class);
             if (behavior.managed())
             {
                 boolean hasValue = behavior.value().length() > 0;
                 if (hasValue)
                 {
-                    types.add(new FacesBehaviorInfo(type, behavior.value()));
+                    types.add(new FacesBehaviorInfo(annotated.getBaseType(), behavior.value()));
                 }
             }
         }
diff --git a/impl/src/main/java/org/apache/myfaces/cdi/converter/FacesConverterExtension.java
b/impl/src/main/java/org/apache/myfaces/cdi/converter/FacesConverterExtension.java
index 8b45c8e..3d2acb9 100644
--- a/impl/src/main/java/org/apache/myfaces/cdi/converter/FacesConverterExtension.java
+++ b/impl/src/main/java/org/apache/myfaces/cdi/converter/FacesConverterExtension.java
@@ -18,7 +18,6 @@
  */
 package org.apache.myfaces.cdi.converter;
 
-import java.lang.reflect.Type;
 import java.util.HashSet;
 import java.util.Set;
 import javax.enterprise.event.Observes;
@@ -39,21 +38,19 @@ public class FacesConverterExtension implements Extension
         Annotated annotated = event.getAnnotatedBeanClass();
         if (annotated.isAnnotationPresent(FacesConverter.class))
         {
-            Type type = annotated.getBaseType();
-
             FacesConverter converter = (FacesConverter) annotated.getAnnotation(FacesConverter.class);
             if (converter.managed())
             {
                 boolean hasForClass = !Object.class.equals(converter.forClass());
                 if (hasForClass)
                 {
-                    types.add(new FacesConverterInfo(type, converter.forClass(), ""));
+                    types.add(new FacesConverterInfo(annotated.getBaseType(), converter.forClass(),
""));
                 }
                 
                 boolean hasValue = converter.value().length() > 0;
                 if (hasValue)
                 {
-                    types.add(new FacesConverterInfo(type, Object.class, converter.value()));
+                    types.add(new FacesConverterInfo(annotated.getBaseType(), Object.class,
converter.value()));
                 }
             }
         }
diff --git a/impl/src/main/java/org/apache/myfaces/cdi/model/FacesDataModelExtension.java
b/impl/src/main/java/org/apache/myfaces/cdi/model/FacesDataModelExtension.java
index 9b8cab4..9515e67 100644
--- a/impl/src/main/java/org/apache/myfaces/cdi/model/FacesDataModelExtension.java
+++ b/impl/src/main/java/org/apache/myfaces/cdi/model/FacesDataModelExtension.java
@@ -19,7 +19,6 @@
 
 package org.apache.myfaces.cdi.model;
 
-import java.lang.reflect.Type;
 import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
@@ -52,14 +51,12 @@ public class FacesDataModelExtension implements Extension
         Annotated annotated = event.getAnnotatedBeanClass();
         if (annotated.isAnnotationPresent(FacesDataModel.class))
         {
-            Type type = annotated.getBaseType();
-
             FacesDataModel model = (FacesDataModel) annotated.getAnnotation(FacesDataModel.class);
 
             boolean hasValue = model.forClass() != null;
             if (hasValue)
             {
-                types.add(new DataModelInfo(type, model.forClass()));
+                types.add(new DataModelInfo(annotated.getBaseType(), model.forClass()));
             }
         }
     }
diff --git a/impl/src/main/java/org/apache/myfaces/cdi/validator/FacesValidatorExtension.java
b/impl/src/main/java/org/apache/myfaces/cdi/validator/FacesValidatorExtension.java
index 7300d8c..52c7e90 100644
--- a/impl/src/main/java/org/apache/myfaces/cdi/validator/FacesValidatorExtension.java
+++ b/impl/src/main/java/org/apache/myfaces/cdi/validator/FacesValidatorExtension.java
@@ -18,7 +18,6 @@
  */
 package org.apache.myfaces.cdi.validator;
 
-import java.lang.reflect.Type;
 import java.util.HashSet;
 import java.util.Set;
 import javax.enterprise.event.Observes;
@@ -39,15 +38,13 @@ public class FacesValidatorExtension implements Extension
         Annotated annotated = event.getAnnotatedBeanClass();
         if (annotated.isAnnotationPresent(FacesValidator.class))
         {
-            Type type = annotated.getBaseType();
-
             FacesValidator validator = (FacesValidator) annotated.getAnnotation(FacesValidator.class);
             if (validator.managed())
             {
                 boolean hasValue = validator.value().length() > 0;
                 if (hasValue)
                 {
-                    types.add(new FacesValidatorInfo(type, validator.value()));
+                    types.add(new FacesValidatorInfo(annotated.getBaseType(), validator.value()));
                 }
             }
         }


Mime
View raw message