bval-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1766102 - in /bval/trunk: bval-core/ bval-jsr/src/main/java/org/apache/bval/cdi/ bval-jsr/src/main/java/org/apache/bval/jsr/xml/
Date Fri, 21 Oct 2016 18:48:54 GMT
Author: struberg
Date: Fri Oct 21 18:48:54 2016
New Revision: 1766102

URL: http://svn.apache.org/viewvc?rev=1766102&view=rev
Log:
BVAL-150 special AnnotationLiteral for empty annotations

Added:
    bval/trunk/bval-jsr/src/main/java/org/apache/bval/cdi/EmptyAnnotationLiteral.java
      - copied, changed from r1766014, openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/annotation/EmptyAnnotationLiteral.java
Modified:
    bval/trunk/bval-core/pom.xml
    bval/trunk/bval-jsr/src/main/java/org/apache/bval/cdi/AnyLiteral.java
    bval/trunk/bval-jsr/src/main/java/org/apache/bval/cdi/BValAnnotatedType.java
    bval/trunk/bval-jsr/src/main/java/org/apache/bval/cdi/DefaultLiteral.java
    bval/trunk/bval-jsr/src/main/java/org/apache/bval/jsr/xml/AnnotationProxyBuilder.java

Modified: bval/trunk/bval-core/pom.xml
URL: http://svn.apache.org/viewvc/bval/trunk/bval-core/pom.xml?rev=1766102&r1=1766101&r2=1766102&view=diff
==============================================================================
--- bval/trunk/bval-core/pom.xml (original)
+++ bval/trunk/bval-core/pom.xml Fri Oct 21 18:48:54 2016
@@ -41,11 +41,14 @@
             <groupId>org.apache.commons</groupId>
             <artifactId>commons-lang3</artifactId>
         </dependency>
+
+        <!-- we only support validation in DynaBeans, but do not use c-beanutils in BVal
itself -->
         <dependency>
             <groupId>commons-beanutils</groupId>
             <artifactId>commons-beanutils-core</artifactId>
             <optional>true</optional>
         </dependency>
+
         <dependency>
             <groupId>org.apache.commons</groupId>
             <artifactId>commons-weaver-privilizer-api</artifactId>
@@ -130,6 +133,7 @@ build.timestamp=${timestamp}
                     <artifactSet>
                         <includes>
                             <include>org.apache.commons:commons-lang3</include>
+                            <include>org.apache.commons:commons-lang3</include>
                         </includes>
                     </artifactSet>
                     <filters>

Modified: bval/trunk/bval-jsr/src/main/java/org/apache/bval/cdi/AnyLiteral.java
URL: http://svn.apache.org/viewvc/bval/trunk/bval-jsr/src/main/java/org/apache/bval/cdi/AnyLiteral.java?rev=1766102&r1=1766101&r2=1766102&view=diff
==============================================================================
--- bval/trunk/bval-jsr/src/main/java/org/apache/bval/cdi/AnyLiteral.java (original)
+++ bval/trunk/bval-jsr/src/main/java/org/apache/bval/cdi/AnyLiteral.java Fri Oct 21 18:48:54
2016
@@ -21,7 +21,7 @@ package org.apache.bval.cdi;
 import javax.enterprise.inject.Any;
 import javax.enterprise.util.AnnotationLiteral;
 
-public class AnyLiteral extends AnnotationLiteral<Any> implements Any {
+public class AnyLiteral extends EmptyAnnotationLiteral<Any> implements Any {
     private static final long serialVersionUID = 1L;
 
     /**
@@ -33,4 +33,5 @@ public class AnyLiteral extends Annotati
     public String toString() {
         return "@javax.enterprise.inject.Any()";
     }
+
 }

Modified: bval/trunk/bval-jsr/src/main/java/org/apache/bval/cdi/BValAnnotatedType.java
URL: http://svn.apache.org/viewvc/bval/trunk/bval-jsr/src/main/java/org/apache/bval/cdi/BValAnnotatedType.java?rev=1766102&r1=1766101&r2=1766102&view=diff
==============================================================================
--- bval/trunk/bval-jsr/src/main/java/org/apache/bval/cdi/BValAnnotatedType.java (original)
+++ bval/trunk/bval-jsr/src/main/java/org/apache/bval/cdi/BValAnnotatedType.java Fri Oct 21
18:48:54 2016
@@ -98,14 +98,15 @@ public class BValAnnotatedType<A> implem
         return false;
     }
 
-    public static class BValBindingLiteral extends AnnotationLiteral<BValBinding> implements
BValBinding {
+    public static class BValBindingLiteral extends EmptyAnnotationLiteral<BValBinding>
implements BValBinding {
         private static final long serialVersionUID = 1L;
 
         public static final Annotation INSTANCE = new BValBindingLiteral();
 
         @Override
-        public Class<? extends Annotation> annotationType() {
-            return BValBinding.class;
+        public String toString() {
+            return "@org.apache.bval.cdi.BValBinding()";
         }
+
     }
 }

Modified: bval/trunk/bval-jsr/src/main/java/org/apache/bval/cdi/DefaultLiteral.java
URL: http://svn.apache.org/viewvc/bval/trunk/bval-jsr/src/main/java/org/apache/bval/cdi/DefaultLiteral.java?rev=1766102&r1=1766101&r2=1766102&view=diff
==============================================================================
--- bval/trunk/bval-jsr/src/main/java/org/apache/bval/cdi/DefaultLiteral.java (original)
+++ bval/trunk/bval-jsr/src/main/java/org/apache/bval/cdi/DefaultLiteral.java Fri Oct 21 18:48:54
2016
@@ -21,7 +21,7 @@ package org.apache.bval.cdi;
 import javax.enterprise.inject.Default;
 import javax.enterprise.util.AnnotationLiteral;
 
-public class DefaultLiteral extends AnnotationLiteral<Default> implements Default {
+public class DefaultLiteral extends EmptyAnnotationLiteral<Default> implements Default
{
     private static final long serialVersionUID = 1L;
 
     public static final DefaultLiteral INSTANCE = new DefaultLiteral();

Copied: bval/trunk/bval-jsr/src/main/java/org/apache/bval/cdi/EmptyAnnotationLiteral.java
(from r1766014, openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/annotation/EmptyAnnotationLiteral.java)
URL: http://svn.apache.org/viewvc/bval/trunk/bval-jsr/src/main/java/org/apache/bval/cdi/EmptyAnnotationLiteral.java?p2=bval/trunk/bval-jsr/src/main/java/org/apache/bval/cdi/EmptyAnnotationLiteral.java&p1=openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/annotation/EmptyAnnotationLiteral.java&r1=1766014&r2=1766102&rev=1766102&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/annotation/EmptyAnnotationLiteral.java
(original)
+++ bval/trunk/bval-jsr/src/main/java/org/apache/bval/cdi/EmptyAnnotationLiteral.java Fri
Oct 21 18:48:54 2016
@@ -16,15 +16,17 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.webbeans.annotation;
+package org.apache.bval.cdi;
 
-import javax.enterprise.util.AnnotationLiteral;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Type;
 
+import javax.enterprise.util.AnnotationLiteral;
+
 /**
  * Base class for AnnotationLiterals which have no members.
+ * Taken from Apache OpenWebBeans.
  * @param <T>
  */
 public abstract class EmptyAnnotationLiteral<T extends Annotation> extends AnnotationLiteral<T>
@@ -54,7 +56,7 @@ public abstract class EmptyAnnotationLit
      * Implemented for performance reasons.
      * This is needed because an Annotation always returns 0 as hashCode
      * if there is no method in it.
-     * Contrary to this the generic {@link javax.enterprise.util.AnnotationLiteral#hashCode()}
+     * Contrary to this the generic {@link AnnotationLiteral#hashCode()}
      * always does search for methods via reflection and only then returns 0.
      * Not very well performing ...
      * @return always 0

Modified: bval/trunk/bval-jsr/src/main/java/org/apache/bval/jsr/xml/AnnotationProxyBuilder.java
URL: http://svn.apache.org/viewvc/bval/trunk/bval-jsr/src/main/java/org/apache/bval/jsr/xml/AnnotationProxyBuilder.java?rev=1766102&r1=1766101&r2=1766102&view=diff
==============================================================================
--- bval/trunk/bval-jsr/src/main/java/org/apache/bval/jsr/xml/AnnotationProxyBuilder.java
(original)
+++ bval/trunk/bval-jsr/src/main/java/org/apache/bval/jsr/xml/AnnotationProxyBuilder.java
Fri Oct 21 18:48:54 2016
@@ -16,6 +16,7 @@
  */
 package org.apache.bval.jsr.xml;
 
+import org.apache.bval.cdi.EmptyAnnotationLiteral;
 import org.apache.bval.jsr.ConstraintAnnotationAttributes;
 import org.apache.bval.util.reflection.Reflection;
 import org.apache.commons.weaver.privilizer.Privileged;
@@ -217,7 +218,7 @@ public final class AnnotationProxyBuilde
         }
     }
 
-    public static final class ValidAnnotation extends AnnotationLiteral<Valid> implements
Valid {
+    public static final class ValidAnnotation extends EmptyAnnotationLiteral<Valid>
implements Valid {
         private static final long serialVersionUID = 1L;
 
         public static final ValidAnnotation INSTANCE = new ValidAnnotation();



Mime
View raw message