[seam-commits] Seam SVN: r9814 - trunk/src/wicket/org/jboss/seam/wicket/ioc.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Mon Dec 22 11:14:51 EST 2008


Author: cpopetz
Date: 2008-12-22 11:14:50 -0500 (Mon, 22 Dec 2008)
New Revision: 9814

Modified:
   trunk/src/wicket/org/jboss/seam/wicket/ioc/JavassistInstrumentor.java
Log:
JBSEAM-3859: Wicket shouldn't instrument classes annotated with @Name


Modified: trunk/src/wicket/org/jboss/seam/wicket/ioc/JavassistInstrumentor.java
===================================================================
--- trunk/src/wicket/org/jboss/seam/wicket/ioc/JavassistInstrumentor.java	2008-12-22 16:12:27 UTC (rev 9813)
+++ trunk/src/wicket/org/jboss/seam/wicket/ioc/JavassistInstrumentor.java	2008-12-22 16:14:50 UTC (rev 9814)
@@ -12,6 +12,7 @@
 import javassist.NotFoundException;
 import javassist.CtField.Initializer;
 
+import org.jboss.seam.annotations.Name;
 import org.jboss.seam.log.LogProvider;
 import org.jboss.seam.log.Logging;
 import org.jboss.seam.wicket.WicketComponent;
@@ -146,7 +147,26 @@
    private static boolean isInstrumentable(CtClass clazz)
    {
       int modifiers = clazz.getModifiers();
-      return !(Modifier.isInterface(modifiers) || Modifier.isEnum(modifiers));
+      if (Modifier.isInterface(modifiers) || Modifier.isEnum(modifiers))
+      {
+         return false;
+      }
+      
+      try 
+      { 
+	      for (Object a : clazz.getAnnotations())
+	      {
+	         if (a instanceof Name)
+	         {
+	            return false;
+	         }
+	      }
+      }
+      catch (ClassNotFoundException e)
+      {
+         throw new RuntimeException(e);
+      }
+      return true;
    }
    
 }




More information about the seam-commits mailing list