You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by rd...@apache.org on 2010/09/10 21:49:31 UTC

svn commit: r995956 - /myfaces/gsoc/webapptest/impl/src/main/java/org/apache/myfaces/test/webapp/impl/AnnotationManager.java

Author: rdebusscher
Date: Fri Sep 10 19:49:31 2010
New Revision: 995956

URL: http://svn.apache.org/viewvc?rev=995956&view=rev
Log:
MYFACESTEST-31: Allow @Tester annotation on a field in a super class

Modified:
    myfaces/gsoc/webapptest/impl/src/main/java/org/apache/myfaces/test/webapp/impl/AnnotationManager.java

Modified: myfaces/gsoc/webapptest/impl/src/main/java/org/apache/myfaces/test/webapp/impl/AnnotationManager.java
URL: http://svn.apache.org/viewvc/myfaces/gsoc/webapptest/impl/src/main/java/org/apache/myfaces/test/webapp/impl/AnnotationManager.java?rev=995956&r1=995955&r2=995956&view=diff
==============================================================================
--- myfaces/gsoc/webapptest/impl/src/main/java/org/apache/myfaces/test/webapp/impl/AnnotationManager.java (original)
+++ myfaces/gsoc/webapptest/impl/src/main/java/org/apache/myfaces/test/webapp/impl/AnnotationManager.java Fri Sep 10 19:49:31 2010
@@ -86,21 +86,23 @@ public class AnnotationManager {
                 }
             }
 
-            if (testerField == null) {
-                throw new IllegalArgumentException("No field annotated with " + Tester.class.getName() + " found");
-            }
-
-            if (!Modifier.isStatic(testerField.getModifiers())) {
-                throw new IllegalArgumentException("Field annotated with " + Tester.class.getName() + " is not static");
-            }
+        }
+        while ((testClass = testClass.getSuperclass()) != Object.class);
 
-            if (!testerField.getType().isAssignableFrom(WebappTesterImpl.class)) {
-                throw new IllegalArgumentException("Field annotated with " + Tester.class.getName() + " must be assignable from " + WebappTesterImpl.class.getName());
-            }
+        if (testerField == null)
+        {
+            throw new IllegalArgumentException("No field annotated with " + Tester.class.getName() + " found");
+        }
 
+        if (!Modifier.isStatic(testerField.getModifiers()))
+        {
+            throw new IllegalArgumentException("Field annotated with " + Tester.class.getName() + " is not static");
         }
-        while ((testClass = testClass.getSuperclass()) != Object.class);
 
+        if (!testerField.getType().isAssignableFrom(WebappTesterImpl.class))
+        {
+            throw new IllegalArgumentException("Field annotated with " + Tester.class.getName() + " must be assignable from " + WebappTesterImpl.class.getName());
+        }
     }