incubator-bval-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r1000649 - /incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/ConstraintAnnotationAttributes.java
Date Thu, 23 Sep 2010 22:21:54 GMT
Author: mbenson
Date: Thu Sep 23 22:21:54 2010
New Revision: 1000649

URL: http://svn.apache.org/viewvc?rev=1000649&view=rev
Log:
return whatever you like

Modified:
    incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/ConstraintAnnotationAttributes.java

Modified: incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/ConstraintAnnotationAttributes.java
URL: http://svn.apache.org/viewvc/incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/ConstraintAnnotationAttributes.java?rev=1000649&r1=1000648&r2=1000649&view=diff
==============================================================================
--- incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/ConstraintAnnotationAttributes.java
(original)
+++ incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/ConstraintAnnotationAttributes.java
Thu Sep 23 22:21:54 2010
@@ -189,10 +189,11 @@ public enum ConstraintAnnotationAttribut
      * @param constraint
      * @return Object
      */
-    public Object getValue(Annotation constraint) {
+    @SuppressWarnings("unchecked")
+    public <T> T getValue(Annotation constraint) {
         validateOn(constraint.annotationType());
         try {
-            return SecureActions.getAnnotationValue(constraint, getAttributeName());
+            return (T) SecureActions.getAnnotationValue(constraint, getAttributeName());
         } catch (Exception e) {
             throw new ValidationException(String.format("Could not get value of %1$s() from
%2$s", getType(),
                 constraint));



Mime
View raw message