You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2008/06/04 04:41:24 UTC

svn commit: r662945 - /myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/MakeComponentsMojo.java

Author: lu4242
Date: Tue Jun  3 19:41:24 2008
New Revision: 662945

URL: http://svn.apache.org/viewvc?rev=662945&view=rev
Log:
fix annotation problem on Component

Modified:
    myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/MakeComponentsMojo.java

Modified: myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/MakeComponentsMojo.java
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/MakeComponentsMojo.java?rev=662945&r1=662944&r2=662945&view=diff
==============================================================================
--- myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/MakeComponentsMojo.java (original)
+++ myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/MakeComponentsMojo.java Tue Jun  3 19:41:24 2008
@@ -496,6 +496,13 @@
                 name.equals("COMPONENT_FAMILY") );
     }
     
+    /**
+     * TODO: Copied from QdoxModelBuilder!
+     * 
+     * @param entity
+     * @param annoName
+     * @return
+     */
     private Annotation getAnnotation(AbstractJavaEntity entity, String annoName)
     {
         Annotation[] annos = entity.getAnnotations();
@@ -517,14 +524,20 @@
             // returns the short
             // class name. So for now, just check for the short name.
             String thisAnnoName = thisAnno.getType().getJavaClass().getName();
+            
+            //Make short name for recognizing, if returns long
+            int containsPoint = thisAnnoName.lastIndexOf('.');
+            if (containsPoint != -1)
+            {
+                thisAnnoName = thisAnnoName.substring(containsPoint+1);
+            }
             if (thisAnnoName.equals(annoName))
             {
                 return thisAnno;
             }
         }
         return null;
-    }
-    
+    }    
     private String _getTemplateName(){
         if (templateComponentName == null){
             if (_is12()){