avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nic...@apache.org
Subject cvs commit: avalon/meta/tools/src/java/org/apache/avalon/meta/info/builder/tags DependencyTag.java SecurityTag.java
Date Thu, 26 Feb 2004 00:02:18 GMT
niclas      2004/02/25 16:02:18

  Modified:    meta/tools/src/java/org/apache/avalon/meta/info/builder/tags
                        DependencyTag.java SecurityTag.java
  Log:
  Fixed that SecurityTag didn't check all methods, only the JavaClass.
  
  Revision  Changes    Path
  1.4       +3 -2      avalon/meta/tools/src/java/org/apache/avalon/meta/info/builder/tags/DependencyTag.java
  
  Index: DependencyTag.java
  ===================================================================
  RCS file: /home/cvs/avalon/meta/tools/src/java/org/apache/avalon/meta/info/builder/tags/DependencyTag.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DependencyTag.java	21 Feb 2004 13:27:04 -0000	1.3
  +++ DependencyTag.java	26 Feb 2004 00:02:18 -0000	1.4
  @@ -90,7 +90,8 @@
           {
               JavaMethod method = m_methods[j];
               boolean flag = method.isConstructor();
  -            if( flag ) n++;
  +            if( flag ) 
  +                n++;
   
               final DocletTag[] tags =
                       method.getTagsByName( getNS()
  
  
  
  1.2       +22 -5     avalon/meta/tools/src/java/org/apache/avalon/meta/info/builder/tags/SecurityTag.java
  
  Index: SecurityTag.java
  ===================================================================
  RCS file: /home/cvs/avalon/meta/tools/src/java/org/apache/avalon/meta/info/builder/tags/SecurityTag.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SecurityTag.java	24 Feb 2004 22:33:44 -0000	1.1
  +++ SecurityTag.java	26 Feb 2004 00:02:18 -0000	1.2
  @@ -28,6 +28,7 @@
   
   import com.thoughtworks.qdox.model.DocletTag;
   import com.thoughtworks.qdox.model.JavaClass;
  +import com.thoughtworks.qdox.model.JavaMethod;
   
   /**
    * A doclet tag the declares a service definition.
  @@ -87,14 +88,30 @@
           final ArrayList permissions = new ArrayList();
           final DocletTag[] tags = 
             getJavaClass().getTagsByName( getNS() + Tags.DELIMITER + PERMISSION_KEY );
  -        for( int i = 0; i < tags.length; i++ )
  -        {
  -            permissions.add( getPermission( tags[i] ) );
  -        }
  +        processTags( tags, permissions );
  +        JavaMethod[] methods = findTaggedMethods( getJavaClass(), getNS() + Tags.DELIMITER
+ PERMISSION_KEY );
  +        processMethods( methods, permissions );
  +        
           return (PermissionDescriptor[])permissions.toArray( 
             new PermissionDescriptor[ permissions.size() ] );
       }
   
  +    private void processTags( DocletTag[] tags, ArrayList permissions )
  +    {
  +        for( int i = 0; i < tags.length; i++ )
  +            permissions.add( getPermission( tags[i] ) );
  +    }
  +
  +    private void processMethods( JavaMethod[] methods, ArrayList permissions )
  +    {
  +        for( int i=0 ; i < methods.length ; i++ )
  +        {
  +            final DocletTag[] tags = 
  +              methods[i].getTagsByName( getNS() + Tags.DELIMITER + PERMISSION_KEY );
  +            processTags( tags, permissions );
  +        }
  +    }
  +        
      /**
       * Return the value of the Avalon 'service' tag.
       * @return the service descriptor or null if no service is declared
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org


Mime
View raw message