commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From leosu...@apache.org
Subject cvs commit: jakarta-commons/attributes/unittest project.properties project.xml
Date Fri, 27 Aug 2004 21:30:12 GMT
leosutic    2004/08/27 14:30:12

  Modified:    attributes build.xml maven.xml project.properties
                        project.xml README.html RELEASE.txt
               attributes/api/src/java/org/apache/commons/attributes
                        AttributeIndex.java AttributeRepositoryClass.java
                        Attributes.java AttributeUtil.java
                        CachedRepository.java CircularDependencyError.java
                        DefaultCachedRepository.java DefaultSealable.java
                        EmptyAttributeRepositoryClass.java
                        EmptyCachedRepository.java Indexed.java
                        Inheritable.java InvalidAttributeTargetError.java
                        MultipleAttributesError.java RepositoryError.java
                        RuntimeAttributeRepository.java Sealable.java
                        Target.java
               attributes/compiler project.xml
               attributes/compiler/src/java/org/apache/commons/attributes/validation
                        AttributeValidator.java ValidationException.java
               attributes/plugin project.xml
               attributes/site/xdocs changelog.xml faq.xml
               attributes/unittest project.xml
  Added:       attributes/unittest project.properties
  Log:
  Javadoc improvements, and removal of attribute precompilation for the
  api and compiler subprojects.
  
  Revision  Changes    Path
  1.8       +1 -5      jakarta-commons/attributes/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/attributes/build.xml,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- build.xml	1 Aug 2004 20:17:58 -0000	1.7
  +++ build.xml	27 Aug 2004 21:30:10 -0000	1.8
  @@ -17,10 +17,6 @@
   = limitations under the License.
   =
   -->
  -<!--
  -build.xml generated by maven from project.xml version 2.1
  -on date August 24 2003, time 1939
  --->
   <project default="jar" name="commons-attributes-api" basedir=".">
       <property name="defaulttargetdir" value="target">
       </property>
  @@ -36,7 +32,7 @@
       </property>
       <property name="javadocdir" value="dist/docs/api">
       </property>
  -    <property name="version" value="2.1">
  +    <property name="version" value="2.2">
       </property>
       <property name="final.name.api" value="commons-attributes-api-${version}">
       </property>
  
  
  
  1.7       +19 -19    jakarta-commons/attributes/maven.xml
  
  Index: maven.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/attributes/maven.xml,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- maven.xml	17 Aug 2004 15:38:45 -0000	1.6
  +++ maven.xml	27 Aug 2004 21:30:10 -0000	1.7
  @@ -27,23 +27,23 @@
       
       <property name="javadoc14.jar" value="${maven.repo.local}/javadoc/jars/javadoc-1.4.jar"/>
       
  -  <!-- ================================================================== -->
  -  <!-- START : C O M M O N S - B U I L D                                  -->
  -  <!-- ================================================================== -->
  -  <!-- Required: Look and Feel for documentation within distributions     -->
  -  <!-- ================================================================== -->
  -  <postGoal name="xdoc:copy-resources">  
  -    <copy todir="${basedir}/target/docs/style/" failonerror="false">
  -      <fileset dir="${basedir}/../commons-build/xdocs/style">
  -      	<include name='**/*'/>
  -      	<exclude name='**/CVS/**'/>
  -      </fileset>
  -    </copy>
  -  </postGoal>
  -  <!-- ================================================================== -->
  -  <!-- END: C O M M O N S - B U I L D                                     -->
  -  <!-- ================================================================== -->
  -
  +    <!-- ================================================================== -->
  +    <!-- START : C O M M O N S - B U I L D                                  -->
  +    <!-- ================================================================== -->
  +    <!-- Required: Look and Feel for documentation within distributions     -->
  +    <!-- ================================================================== -->
  +    <postGoal name="xdoc:copy-resources">  
  +        <copy todir="${basedir}/target/docs/style/" failonerror="false">
  +            <fileset dir="${basedir}/../commons-build/xdocs/style">
  +                <include name='**/*'/>
  +                <exclude name='**/CVS/**'/>
  +            </fileset>
  +        </copy>
  +    </postGoal>
  +    <!-- ================================================================== -->
  +    <!-- END: C O M M O N S - B U I L D                                     -->
  +    <!-- ================================================================== -->
  +    
       <goal name="attributes:help"
           description="Print some help.">
           <echo><![CDATA[
  @@ -269,9 +269,9 @@
           <mkdir dir="${basedir}/target/docs/api" />
           <property name="copyright"
               value="Copyright &amp;copy; ${year} ${pom.organization.name}. All Rights Reserved." />
  -        <property name="title" value="${pom.name} ${pom.currentVersion} API"/>
  +        <property name="title" value="Commons-${pom.name} ${pom.currentVersion} API"/>
           <javadoc destdir="${basedir}/target/docs/api" 
  -            doctitle="&lt;h1&gt;Jakarta Commons Attributes&lt;/h1&gt;" 
  +            doctitle="&lt;h1&gt;Jakarta Commons Attributes 2.2&lt;/h1&gt;" 
               noindex="false" author="true" use="true"
               windowtitle="${title}" 
               bottom="${copyright}"
  
  
  
  1.3       +1 -6      jakarta-commons/attributes/project.properties
  
  Index: project.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/attributes/project.properties,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- project.properties	24 Jul 2004 13:54:30 -0000	1.2
  +++ project.properties	27 Aug 2004 21:30:10 -0000	1.3
  @@ -71,10 +71,5 @@
   ######################################################################
   maven.javadoc.links = http://java.sun.com/j2se/1.4.2/docs/api/
   
  -######################################################################
  -# Commons-Attributes
  -######################################################################
  -org.apache.commons.attributes.enable=true
  -org.apache.commons.attributes.index.enable=true
   
        
  
  
  
  1.7       +1 -1      jakarta-commons/attributes/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/attributes/project.xml,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- project.xml	26 Jul 2004 20:48:58 -0000	1.6
  +++ project.xml	27 Aug 2004 21:30:10 -0000	1.7
  @@ -29,7 +29,7 @@
           <logo>http://jakarta.apache.org/images/jakarta-logo.gif</logo>
       </organization>
       
  -    <currentVersion>2.1</currentVersion>
  +    <currentVersion>2.2</currentVersion>
       <inceptionYear>2003</inceptionYear>
       <shortDescription>Commons Attributes</shortDescription>
       <description>A package for handling runtime information about types (including Java classes)</description>
  
  
  
  1.2       +5 -5      jakarta-commons/attributes/README.html
  
  Index: README.html
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/attributes/README.html,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- README.html	1 Aug 2004 20:59:17 -0000	1.1
  +++ README.html	27 Aug 2004 21:30:10 -0000	1.2
  @@ -1,6 +1,6 @@
  -<h1>Commons-Attributes 2.1</h1>
  +<h1>Commons-Attributes 2.2</h1>
   
  -<p>This is the 2.1 version of commons-attributes. It is available in both binary and source distributions.</p>
  +<p>This is the 2.2 version of commons-attributes. It is available in both binary and source distributions.</p>
   
   
   <p><font color="red" size="+2">Note:</font>
  @@ -29,13 +29,13 @@
   
   <pre>Always test available signatures, <i>e.g.</i>,
   $ pgpk -a KEYS
  -$ pgpv commons-attributes-2.1.tgz.asc
  +$ pgpv commons-attributes-2.2.tgz.asc
   or,
   $ pgp -ka KEYS
  -$ pgp commons-attributes-2.1.tgz.asc
  +$ pgp commons-attributes-2.2.tgz.asc
   or,
   $ gpg --import KEYS
  -$ gpg --verify commons-attributes-2.1.tgz.asc
  +$ gpg --verify commons-attributes-2.2.tgz.asc
   </pre>
   <p>
   
  
  
  
  1.2       +5 -0      jakarta-commons/attributes/RELEASE.txt
  
  Index: RELEASE.txt
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/attributes/RELEASE.txt,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RELEASE.txt	26 Jul 2004 20:48:58 -0000	1.1
  +++ RELEASE.txt	27 Aug 2004 21:30:10 -0000	1.2
  @@ -16,6 +16,11 @@
   
   = Release Notes for Commons-Attributes =
   
  +== 2.2 ==
  +
  + + Added getCause() to applicable Throwables, making them compliant 
  +   with the standard Java2 1.4 nested throwable spec.
  +
   == 2.1 ==
   
    + Made the Maven plugin only run the attribute compiler if
  
  
  
  1.2       +50 -0     jakarta-commons/attributes/api/src/java/org/apache/commons/attributes/AttributeIndex.java
  
  Index: AttributeIndex.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/attributes/api/src/java/org/apache/commons/attributes/AttributeIndex.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AttributeIndex.java	6 Jul 2004 20:41:08 -0000	1.1
  +++ AttributeIndex.java	27 Aug 2004 21:30:10 -0000	1.2
  @@ -37,6 +37,8 @@
    * requires that the attribute is {@link Indexed} and that the
    * attribute indexer tool has been run on the jar file containing the
    * classes.
  + *
  + * @since 2.1
    */
   public class AttributeIndex {
       
  @@ -44,6 +46,8 @@
        * Reference to a method parameter. A method parameter
        * is defined by the Method object it is defined in, and the index
        * of the parameter in the method's parameter list.
  +     *
  +     * @since 2.1
        */
       public static class MethodParameter {
           
  @@ -52,6 +56,8 @@
           
           /**
            * Constructs a new MethodParameter.
  +         *
  +         * @since 2.1
            */
           public MethodParameter (Method method, int index) {
               this.method = method;
  @@ -60,6 +66,8 @@
           
           /**
            * Get the method this parameter is defined in.
  +         *
  +         * @since 2.1
            */
           public Method getMethod () {
               return method;
  @@ -67,6 +75,8 @@
           
           /**
            * Get the index of this parameter in the parameter list of the method.
  +         *
  +         * @since 2.1
            */
           public int getIndex () {
               return index;
  @@ -75,6 +85,8 @@
           /**
            * Compares two <code>MethodParameter</code>s for equality.
            * They must point to the same method and have the same index.
  +         *
  +         * @since 2.1
            */
           public boolean equals (Object o) {
               return o != null && o instanceof MethodParameter &&
  @@ -84,6 +96,8 @@
           
           /**
            * Computes the hashCode.
  +         *
  +         * @since 2.1
            */        
           public int hashCode () {
               return method.hashCode () + index;
  @@ -91,6 +105,8 @@
           
           /**
            * Converts this method parameter into a human-readable string.
  +         *
  +         * @since 2.1
            */
           public String toString () {
               return method.toString () + ":" + index;
  @@ -101,6 +117,8 @@
        * A constructor parameter. A method parameter
        * is defined by the Method object it is defined in, and the index
        * of the parameter in the method's parameter list.
  +     *
  +     * @since 2.1
        */
       public static class ConstructorParameter {
           
  @@ -110,6 +128,8 @@
           
           /**
            * Constructs a new ConstructorParameter.
  +         *
  +         * @since 2.1
            */
           public ConstructorParameter (Constructor ctor, int index) {
               this.ctor = ctor;
  @@ -118,6 +138,8 @@
           
           /**
            * Get the constructor this parameter is defined in.
  +         *
  +         * @since 2.1
            */
           public Constructor getConstructor () {
               return ctor;
  @@ -125,6 +147,8 @@
           
           /**
            * Get the index of this parameter in the parameter list of the constructor.
  +         *
  +         * @since 2.1
            */
           public int getIndex () {
               return index;
  @@ -133,6 +157,8 @@
           /**
            * Compares two <code>ConstructorParameter</code>s for equality.
            * They must point to the same constructor and have the same index.
  +         *
  +         * @since 2.1
            */
           public boolean equals (Object o) {
               return o != null && o instanceof ConstructorParameter &&
  @@ -142,6 +168,8 @@
           
           /**
            * Computes the hashCode.
  +         *
  +         * @since 2.1
            */    
           public int hashCode () {
               return ctor.hashCode () + index;
  @@ -149,6 +177,8 @@
           
           /**
            * Converts this constructor parameter into a human-readable string.
  +         *
  +         * @since 2.1
            */
           public String toString () {
               return ctor.toString () + ":" + index;
  @@ -184,6 +214,8 @@
       
       /**
        * Creates a new AttributeIndex for the given ClassLoader.
  +     *
  +     * @since 2.1
        */
       public AttributeIndex (ClassLoader cl) throws Exception {
           this.classLoader = cl;
  @@ -321,6 +353,8 @@
       
       /**
        * Load the attrs.index from a given URL.
  +     *
  +     * @since 2.1
        */
       private void loadFromURL (URL url) throws Exception {
           URLConnection connection = url.openConnection ();
  @@ -344,6 +378,8 @@
        * The Collection contains the class names (String).
        * 
        * @deprecated Use the getClasses(Class) method instead.
  +     *
  +     * @since 2.1
        */    
       public Collection getClassesWithAttribute (String attributeClass) {
           if (index.containsKey (attributeClass)) {
  @@ -372,6 +408,8 @@
       /**
        * Gets a Collection of the <code>Class</code>es that have an attribute of the specified class.
        * The Collection contains the classes (Class).
  +     *
  +     * @since 2.1
        */    
       public Collection getClasses (Class attributeClass) {
           if (index.containsKey (attributeClass.getName ())) {
  @@ -384,6 +422,8 @@
       /**
        * Gets a Collection of the <code>Method</code>s that have an attribute of the specified class.
        * The Collection contains the methods (java.lang.reflect.Method).
  +     *
  +     * @since 2.1
        */    
       public Collection getMethods (Class attributeClass) {
           if (index.containsKey (attributeClass.getName ())) {
  @@ -396,6 +436,8 @@
       /**
        * Gets a Collection of the <code>Method</code>s whose return value has an attribute of the specified class.
        * The Collection contains the methods (java.lang.reflect.Method).
  +     *
  +     * @since 2.1
        */    
       public Collection getMethodsReturning (Class attributeClass) {
           if (index.containsKey (attributeClass.getName ())) {
  @@ -408,6 +450,8 @@
       /**
        * Gets a Collection of the <code>Field</code>s that have an attribute of the specified class.
        * The Collection contains the methods (java.lang.reflect.Field).
  +     *
  +     * @since 2.1
        */    
       public Collection getFields (Class attributeClass) {
           if (index.containsKey (attributeClass.getName ())) {
  @@ -420,6 +464,8 @@
       /**
        * Gets a Collection of the <code>Constructor</code>s that have an attribute of the specified class.
        * The Collection contains the methods (java.lang.reflect.Constructor).
  +     *
  +     * @since 2.1
        */    
       public Collection getConstructors (Class attributeClass) {
           if (index.containsKey (attributeClass.getName ())) {
  @@ -432,6 +478,8 @@
       /**
        * Gets a Collection of the <code>ConstructorParameter</code>s that have an attribute of the specified class.
        * The Collection contains the methods ({@link AttributeIndex.ConstructorParameter}).
  +     *
  +     * @since 2.1
        */    
       public Collection getConstructorParameters (Class attributeClass) {
           if (index.containsKey (attributeClass.getName ())) {
  @@ -444,6 +492,8 @@
       /**
        * Gets a Collection of the <code>MethodParameter</code>s that have an attribute of the specified class.
        * The Collection contains the methods ({@link AttributeIndex.MethodParameter}).
  +     *
  +     * @since 2.1
        */    
       public Collection getMethodParameters (Class attributeClass) {
           if (index.containsKey (attributeClass.getName ())) {
  
  
  
  1.2       +12 -2     jakarta-commons/attributes/api/src/java/org/apache/commons/attributes/AttributeRepositoryClass.java
  
  Index: AttributeRepositoryClass.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/attributes/api/src/java/org/apache/commons/attributes/AttributeRepositoryClass.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AttributeRepositoryClass.java	6 Jul 2004 20:41:08 -0000	1.1
  +++ AttributeRepositoryClass.java	27 Aug 2004 21:30:10 -0000	1.2
  @@ -23,12 +23,16 @@
    * This interface is used internally and should not be used
    * by clients. The only reason it is public is because the
    * classes implementing it may be in any package.
  + *
  + * @since 2.1
    */
   public interface AttributeRepositoryClass {
       
       /**
        * Returns a set containing all attributes (instances) associated with this class.
        * Should not return any attributes of superclasses etc.
  +     *
  +     * @since 2.1
        */
       public Set getClassAttributes ();
       
  @@ -36,6 +40,8 @@
        * Returns a map with String keys and Set values. The keys correspond to field names,
        * and their associated Set values are the set of all attributes (instances) associated with that field.
        * Should not return any attributes of superclasses etc.
  +     *
  +     * @since 2.1
        */
       public Map getFieldAttributes ();
       
  @@ -50,7 +56,9 @@
        *
        * All slots in the list must be filled, not just those where there are attributes.
        * 
  -     * Should not return any attributes of superclasses etc.
  +     * <p>Should not return any attributes of superclasses etc.
  +     *
  +     * @since 2.1
        */
       public Map getMethodAttributes ();
       
  @@ -64,7 +72,9 @@
        *
        * All slots in the list must be filled, not just those where there are attributes.
        * 
  -     * Should not return any attributes of superclasses etc.
  +     * <p>Should not return any attributes of superclasses etc.
  +     *
  +     * @since 2.1
        */
       public Map getConstructorAttributes ();
   }
  
  
  
  1.2       +79 -0     jakarta-commons/attributes/api/src/java/org/apache/commons/attributes/Attributes.java
  
  Index: Attributes.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/attributes/api/src/java/org/apache/commons/attributes/Attributes.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Attributes.java	6 Jul 2004 20:41:25 -0000	1.1
  +++ Attributes.java	27 Aug 2004 21:30:10 -0000	1.2
  @@ -86,6 +86,8 @@
    * </code></pre>
    *
    * if the loop should run at maximum speed.
  + *
  + * @since 2.1
    */
   public class Attributes {
       
  @@ -188,6 +190,8 @@
        * @return the attribute instance, or null of none could be found.
        * @throws MultipleAttributesError if the collection contains more than one
        *         instance of the specified class.
  +     *
  +     * @since 2.1
        */
       public static Object getAttribute (Class clazz, Class attributeClass) throws RepositoryError, MultipleAttributesError {
           return getAttribute (getAttributes (clazz), attributeClass);
  @@ -199,6 +203,8 @@
        * @return the attribute instance, or null of none could be found.
        * @throws MultipleAttributesError if the collection contains more than one
        *         instance of the specified class.
  +     *
  +     * @since 2.1
        */
       public static Object getAttribute (Field field, Class attributeClass) throws RepositoryError, MultipleAttributesError {
           return getAttribute (getAttributes (field), attributeClass);
  @@ -210,6 +216,8 @@
        * @return the attribute instance, or null of none could be found.
        * @throws MultipleAttributesError if the collection contains more than one
        *         instance of the specified class.
  +     *
  +     * @since 2.1
        */
       public static Object getAttribute (Constructor ctor, Class attributeClass) throws RepositoryError, MultipleAttributesError {
           return getAttribute (getAttributes (ctor), attributeClass);
  @@ -221,6 +229,8 @@
        * @return the attribute instance, or null of none could be found.
        * @throws MultipleAttributesError if the collection contains more than one
        *         instance of the specified class.
  +     *
  +     * @since 2.1
        */
       public static Object getAttribute (Method method, Class attributeClass) throws RepositoryError, MultipleAttributesError {
           return getAttribute (getAttributes (method), attributeClass);
  @@ -232,6 +242,8 @@
        * @return the attribute instance, or null of none could be found.
        * @throws MultipleAttributesError if the collection contains more than one
        *         instance of the specified class.
  +     *
  +     * @since 2.1
        */
       public static Object getParameterAttribute (Method method, int parameter, Class attributeClass) throws RepositoryError, MultipleAttributesError {
           return getAttribute (getParameterAttributes (method, parameter), attributeClass);
  @@ -243,6 +255,8 @@
        * @return the attribute instance, or null of none could be found.
        * @throws MultipleAttributesError if the collection contains more than one
        *         instance of the specified class.
  +     *
  +     * @since 2.1
        */
       public static Object getParameterAttribute (Constructor constructor, int parameter, Class attributeClass) throws RepositoryError, MultipleAttributesError {
           return getAttribute (getParameterAttributes (constructor, parameter), attributeClass);
  @@ -254,6 +268,8 @@
        * @return the attribute instance, or null of none could be found.
        * @throws MultipleAttributesError if the collection contains more than one
        *         instance of the specified class.
  +     *
  +     * @since 2.1
        */
       public static Object getReturnAttribute (Method method, Class attributeClass) throws RepositoryError, MultipleAttributesError {
           return getAttribute (getReturnAttributes (method), attributeClass);
  @@ -261,6 +277,8 @@
       
       /**
        * Gets all attributes for a class.
  +     *
  +     * @since 2.1
        */
       public static Collection getAttributes (Class clazz) throws RepositoryError {
           if (clazz == null) {
  @@ -272,6 +290,8 @@
       
       /**
        * Gets all attributes for a method.
  +     *
  +     * @since 2.1
        */
       public static Collection getAttributes (Method method) throws RepositoryError {
           if (method == null) {
  @@ -283,6 +303,8 @@
       
       /**
        * Gets all attributes for a parameter of a method.
  +     *
  +     * @since 2.1
        */
       public static Collection getParameterAttributes (Method method, int parameter) throws RepositoryError {
           return getCachedRepository (method.getDeclaringClass()).getParameterAttributes (method, parameter);
  @@ -290,6 +312,8 @@
       
       /**
        * Gets all attributes for a parameter of a constructor.
  +     *
  +     * @since 2.1
        */
       public static Collection getParameterAttributes (Constructor constructor, int parameter) throws RepositoryError {
           if (constructor == null) {
  @@ -300,6 +324,8 @@
       
       /**
        * Gets all attributes for the return value of a method.
  +     *
  +     * @since 2.1
        */
       public static Collection getReturnAttributes (Method method) throws RepositoryError {
           if (method == null) {
  @@ -310,6 +336,8 @@
       
       /**
        * Gets all attributes for a field.
  +     *
  +     * @since 2.1
        */
       public static Collection getAttributes (Field field) throws RepositoryError {
           if (field == null) {
  @@ -320,6 +348,8 @@
       
       /**
        * Gets all attributes for a constructor.
  +     *
  +     * @since 2.1
        */
       public static Collection getAttributes (Constructor cons) throws RepositoryError {
           if (cons == null) {
  @@ -330,6 +360,8 @@
       
       /**
        * Selects from a collection of attributes only those with a given class.
  +     *
  +     * @since 2.1
        */
       private static Collection getAttributes (Collection attrs, Class attributeClass) {
           HashSet result = new HashSet ();
  @@ -347,6 +379,8 @@
       /**
        * Get all attributes of a given type from a class. For all objects o in the returned 
        * collection, <code>o.getClass() == attributeClass</code>.
  +     *
  +     * @since 2.1
        */
       public static Collection getAttributes (Class clazz, Class attributeClass) throws RepositoryError {
           return getAttributes (getAttributes (clazz), attributeClass);
  @@ -355,6 +389,8 @@
       /**
        * Get all attributes of a given type from a field. For all objects o in the returned 
        * collection, <code>o.getClass() == attributeClass</code>.
  +     *
  +     * @since 2.1
        */
       public static Collection getAttributes (Field field, Class attributeClass) throws RepositoryError {
           return getAttributes (getAttributes (field), attributeClass);
  @@ -363,6 +399,8 @@
       /**
        * Get all attributes of a given type from a constructor. For all objects o in the returned 
        * collection, <code>o.getClass() == attributeClass</code>.
  +     *
  +     * @since 2.1
        */
       public static Collection getAttributes (Constructor ctor, Class attributeClass) throws RepositoryError {
           return getAttributes (getAttributes (ctor), attributeClass);
  @@ -371,6 +409,8 @@
       /**
        * Get all attributes of a given type from a method. For all objects o in the returned 
        * collection, <code>o.getClass() == attributeClass</code>.
  +     *
  +     * @since 2.1
        */
       public static Collection getAttributes (Method method, Class attributeClass) throws RepositoryError {
           return getAttributes (getAttributes (method), attributeClass);
  @@ -379,6 +419,8 @@
       /**
        * Get all attributes of a given type from a method's parameter. For all objects o in the returned 
        * collection, <code>o.getClass() == attributeClass</code>.
  +     *
  +     * @since 2.1
        */
       public static Collection getParameterAttributes (Method method, int parameter, Class attributeClass) throws RepositoryError {
           return getAttributes (getParameterAttributes (method, parameter), attributeClass);
  @@ -387,6 +429,8 @@
       /**
        * Get all attributes of a given type from a method's parameter. For all objects o in the returned 
        * collection, <code>o.getClass() == attributeClass</code>.
  +     *
  +     * @since 2.1
        */
       public static Collection getParameterAttributes (Constructor constructor, int parameter, Class attributeClass) throws RepositoryError {
           return getAttributes (getParameterAttributes (constructor, parameter), attributeClass);
  @@ -395,6 +439,8 @@
       /**
        * Get all attributes of a given type from a method's return value. For all objects o in the returned 
        * collection, <code>o.getClass() == attributeClass</code>.
  +     *
  +     * @since 2.1
        */
       public static Collection getReturnAttributes (Method method, Class attributeClass) throws RepositoryError {
           return getAttributes (getReturnAttributes (method), attributeClass);
  @@ -403,6 +449,8 @@
       /**
        * Convenience function to test whether a collection of attributes contain
        * an attribute of a given class.
  +     *
  +     * @since 2.1
        */
       private static boolean hasAttributeType (Collection attrs, Class attributeClass) {
           Iterator iter = attrs.iterator ();
  @@ -419,6 +467,8 @@
       /**
        * Tests if a class has an attribute of a given type. That is, is there any attribute
        * <code>attr</code> such that <code>attr.getClass() == attributeClass</code>?
  +     *
  +     * @since 2.1
        */
       public static boolean hasAttributeType (Class clazz, Class attributeClass) throws RepositoryError {
           return hasAttributeType (getAttributes (clazz), attributeClass);
  @@ -427,6 +477,8 @@
       /**
        * Tests if a field has an attribute of a given type. That is, is there any attribute
        * <code>attr</code> such that <code>attr.getClass() == attributeClass</code>?
  +     *
  +     * @since 2.1
        */
       public static boolean hasAttributeType (Field field, Class attributeClass) throws RepositoryError {
           return hasAttributeType (getAttributes (field), attributeClass);
  @@ -435,6 +487,8 @@
       /**
        * Tests if a constructor has an attribute of a given type. That is, is there any attribute
        * <code>attr</code> such that <code>attr.getClass() == attributeClass</code>?
  +     *
  +     * @since 2.1
        */
       public static boolean hasAttributeType (Constructor ctor, Class attributeClass) throws RepositoryError {
           return hasAttributeType (getAttributes (ctor), attributeClass);
  @@ -443,6 +497,8 @@
       /**
        * Tests if a method has an attribute of a given type. That is, is there any attribute
        * <code>attr</code> such that <code>attr.getClass() == attributeClass</code>?
  +     *
  +     * @since 2.1
        */
       public static boolean hasAttributeType (Method method, Class attributeClass) throws RepositoryError {
           return hasAttributeType (getAttributes (method), attributeClass);
  @@ -451,6 +507,8 @@
       /**
        * Tests if a method's parameter has an attribute of a given type. That is, is there any attribute
        * <code>attr</code> such that <code>attr.getClass() == attributeClass</code>?
  +     *
  +     * @since 2.1
        */
       public static boolean hasParameterAttributeType (Method method, int parameter, Class attributeClass) throws RepositoryError {
           return hasAttributeType (getParameterAttributes (method, parameter), attributeClass);
  @@ -459,6 +517,8 @@
       /**
        * Tests if a constructor's parameter has an attribute of a given type. That is, is there any attribute
        * <code>attr</code> such that <code>attr.getClass() == attributeClass</code>?
  +     *
  +     * @since 2.1
        */
       public static boolean hasParameterAttributeType (Constructor constructor, int parameter, Class attributeClass) throws RepositoryError {
           return hasAttributeType (getParameterAttributes (constructor, parameter), attributeClass);
  @@ -467,6 +527,8 @@
       /**
        * Tests if a method's return value has an attribute of a given type. That is, is there any attribute
        * <code>attr</code> such that <code>attr.getClass() == attributeClass</code>?
  +     *
  +     * @since 2.1
        */
       public static boolean hasReturnAttributeType (Method method, Class attributeClass) throws RepositoryError {
           return hasAttributeType (getReturnAttributes (method), attributeClass);
  @@ -475,6 +537,8 @@
       /**
        * Convenience function to test whether a collection of attributes contain
        * an attribute.
  +     *
  +     * @since 2.1
        */
       private static boolean hasAttribute (Collection attrs, Object attribute) throws RepositoryError {
           return attrs.contains (attribute);
  @@ -483,6 +547,8 @@
       /**
        * Tests if a class has an attribute. That is, is there any attribute
        * <code>attr</code> such that <code>attr.equals(attribute)</code>?
  +     *
  +     * @since 2.1
        */
       public static boolean hasAttribute (Class clazz, Object attribute) throws RepositoryError {
           return hasAttribute (getAttributes (clazz), attribute);
  @@ -491,6 +557,8 @@
       /**
        * Tests if a field has an attribute. That is, is there any attribute
        * <code>attr</code> such that <code>attr.equals(attribute)</code>?
  +     *
  +     * @since 2.1
        */
       public static boolean hasAttribute (Field field, Object attribute) throws RepositoryError {
           return hasAttribute (getAttributes (field), attribute);
  @@ -499,6 +567,8 @@
       /**
        * Tests if a constructor has an attribute. That is, is there any attribute
        * <code>attr</code> such that <code>attr.equals(attribute)</code>?
  +     *
  +     * @since 2.1
        */
       public static boolean hasAttribute (Constructor ctor, Object attribute) throws RepositoryError {
           return hasAttribute (getAttributes (ctor), attribute);
  @@ -507,6 +577,8 @@
       /**
        * Tests if a method has an attribute. That is, is there any attribute
        * <code>attr</code> such that <code>attr.equals(attribute)</code>?
  +     *
  +     * @since 2.1
        */
       public static boolean hasAttribute (Method method, Object attribute) throws RepositoryError {
           return hasAttribute (getAttributes (method), attribute);
  @@ -515,6 +587,8 @@
       /**
        * Tests if a method's parameter has an attribute. That is, is there any attribute
        * <code>attr</code> such that <code>attr.equals(attribute)</code>?
  +     *
  +     * @since 2.1
        */
       public static boolean hasParameterAttribute (Method method, int parameter, Object attribute) throws RepositoryError {
           return hasAttribute (getParameterAttributes (method, parameter), attribute);
  @@ -523,6 +597,8 @@
       /**
        * Tests if a constructor's parameter has an attribute. That is, is there any attribute
        * <code>attr</code> such that <code>attr.equals(attribute)</code>?
  +     *
  +     * @since 2.1
        */
       public static boolean hasParameterAttribute (Constructor constructor, int parameter, Object attribute) throws RepositoryError {
           return hasAttribute (getParameterAttributes (constructor, parameter), attribute);
  @@ -531,6 +607,8 @@
       /**
        * Tests if a method's return value has an attribute. That is, is there any attribute
        * <code>attr</code> such that <code>attr.equals(attribute)</code>?
  +     *
  +     * @since 2.1
        */
       public static boolean hasReturnAttribute (Method method, Object attribute) throws RepositoryError {
           return hasAttribute (getReturnAttributes (method), attribute);
  @@ -547,6 +625,7 @@
        *             during setting.
        * @throws IllegalStateException if the class whose attributes are defined already have
        *         attributes defined for it (even if it has no attributes).
  +     * @since 2.1
        */
       public static synchronized void setAttributes (RuntimeAttributeRepository repo) throws IllegalStateException {
           repo.seal ();
  
  
  
  1.2       +6 -0      jakarta-commons/attributes/api/src/java/org/apache/commons/attributes/AttributeUtil.java
  
  Index: AttributeUtil.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/attributes/api/src/java/org/apache/commons/attributes/AttributeUtil.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AttributeUtil.java	6 Jul 2004 20:41:25 -0000	1.1
  +++ AttributeUtil.java	27 Aug 2004 21:30:10 -0000	1.2
  @@ -30,6 +30,8 @@
   
   /**
    * Commonly used convenience functions.
  + *
  + * @since 2.1
    */
   public class AttributeUtil {
       
  @@ -44,6 +46,8 @@
        * @param classes Collection of Classes to filter. May contain <code>null</code> references,
        *                but may not itself be <code>null</code>.
        * @param attributeClass the class to filter based on.
  +     *
  +     * @since 2.1
        */
       public static Collection getClassesWithAttributeType (Collection classes, Class attributeClass) {
           if (classes == null) {
  @@ -79,6 +83,8 @@
        * @param objects Collection of objects to filter. May contain <code>null</code> references,
        *                but may not itself be <code>null</code>.
        * @param attributeClass the class to filter based on.
  +     *
  +     * @since 2.1
        */
       public static Collection getObjectsWithAttributeType (Collection objects, Class attributeClass) {
           if (objects == null) {
  
  
  
  1.2       +2 -0      jakarta-commons/attributes/api/src/java/org/apache/commons/attributes/CachedRepository.java
  
  Index: CachedRepository.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/attributes/api/src/java/org/apache/commons/attributes/CachedRepository.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CachedRepository.java	6 Jul 2004 20:41:27 -0000	1.1
  +++ CachedRepository.java	27 Aug 2004 21:30:10 -0000	1.2
  @@ -23,6 +23,8 @@
   /**
    * An attribute repository cache. Used internally to speed up operation.
    * All collections returned should be unmodifiable.
  + *
  + * @since 2.1
    */
   interface CachedRepository {
       
  
  
  
  1.2       +7 -1      jakarta-commons/attributes/api/src/java/org/apache/commons/attributes/CircularDependencyError.java
  
  Index: CircularDependencyError.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/attributes/api/src/java/org/apache/commons/attributes/CircularDependencyError.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CircularDependencyError.java	6 Jul 2004 20:41:27 -0000	1.1
  +++ CircularDependencyError.java	27 Aug 2004 21:30:10 -0000	1.2
  @@ -21,9 +21,11 @@
   /**
    * Thrown when an attribute repository class can't be
    * loaded because it resulted in a circular dependency.
  + *
  + * @since 2.1
    */
   public class CircularDependencyError extends RepositoryError {
  -   
  +    
       /**
        * Create a new CircularDependencyError.
        *
  @@ -33,6 +35,8 @@
        *                       depended on, and so on. The list should
        *                       show the chain of dependencies that resulted
        *                       in the exception being thrown.
  +     *
  +     * @since 2.1
        */
       public CircularDependencyError (String className, List dependencyList) {
           super (className + ":" + listDeps (dependencyList), null);
  @@ -42,6 +46,8 @@
        * Joins together the elements of a list with <code>-&gt;</code>
        * delimiters. Used to show the sequence that resulted in the circular
        * dependency.
  +     *
  +     * @since 2.1
        */
       private static String listDeps (List dependencyList) {
           StringBuffer sb = new StringBuffer ();
  
  
  
  1.2       +4 -0      jakarta-commons/attributes/api/src/java/org/apache/commons/attributes/DefaultCachedRepository.java
  
  Index: DefaultCachedRepository.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/attributes/api/src/java/org/apache/commons/attributes/DefaultCachedRepository.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DefaultCachedRepository.java	6 Jul 2004 20:41:39 -0000	1.1
  +++ DefaultCachedRepository.java	27 Aug 2004 21:30:10 -0000	1.2
  @@ -29,6 +29,10 @@
   import java.util.HashSet;
   import java.util.HashMap;
   
  +/**
  + *
  + * @since 2.1
  + */
   class DefaultCachedRepository implements CachedRepository {
       
       private final static Collection EMPTY_COLLECTION = new ArrayList (0);
  
  
  
  1.2       +10 -1     jakarta-commons/attributes/api/src/java/org/apache/commons/attributes/DefaultSealable.java
  
  Index: DefaultSealable.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/attributes/api/src/java/org/apache/commons/attributes/DefaultSealable.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DefaultSealable.java	6 Jul 2004 20:41:40 -0000	1.1
  +++ DefaultSealable.java	27 Aug 2004 21:30:10 -0000	1.2
  @@ -18,6 +18,8 @@
   /**
    * Implementation of the {@link Sealable} interface. Subclasses should call
    * {@link #checkSealed()} before setting any bean properties.
  + *
  + * @since 2.1
    */
   public class DefaultSealable implements Sealable {
       
  @@ -25,8 +27,11 @@
        * Boolean flag indicating whether the {@link seal()} method
        * has been called.
        */
  -    private boolean sealed = false;
  +    private volatile boolean sealed = false;
       
  +    /** 
  +     * Default ctor.
  +     */
       public DefaultSealable () {
       }
       
  @@ -35,6 +40,8 @@
        * <code>IllegalStateException</code> if it has.
        *
        * @throws IllegalStateException if this attribute has been sealed.
  +     *
  +     * @since 2.1
        */
       protected void checkSealed () throws IllegalStateException {
           if (sealed) {
  @@ -46,6 +53,8 @@
        * Seals this attribute. Any future calls to the
        * {@link #checkSealed()} method will result in an 
        * <code>IllegalStateException</code> being thrown.
  +     *
  +     * @since 2.1
        */
       public void seal () {
           this.sealed = true;
  
  
  
  1.2       +2 -0      jakarta-commons/attributes/api/src/java/org/apache/commons/attributes/EmptyAttributeRepositoryClass.java
  
  Index: EmptyAttributeRepositoryClass.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/attributes/api/src/java/org/apache/commons/attributes/EmptyAttributeRepositoryClass.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- EmptyAttributeRepositoryClass.java	6 Jul 2004 20:41:40 -0000	1.1
  +++ EmptyAttributeRepositoryClass.java	27 Aug 2004 21:30:10 -0000	1.2
  @@ -21,6 +21,8 @@
   
   /**
    * Empty implementation of AttributeRepositoryClass.
  + *
  + * @since 2.1
    */
   class EmptyAttributeRepositoryClass implements AttributeRepositoryClass {
       
  
  
  
  1.2       +2 -0      jakarta-commons/attributes/api/src/java/org/apache/commons/attributes/EmptyCachedRepository.java
  
  Index: EmptyCachedRepository.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/attributes/api/src/java/org/apache/commons/attributes/EmptyCachedRepository.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- EmptyCachedRepository.java	6 Jul 2004 20:41:46 -0000	1.1
  +++ EmptyCachedRepository.java	27 Aug 2004 21:30:10 -0000	1.2
  @@ -23,6 +23,8 @@
   
   /**
    * Null implementation of a cached repository.
  + *
  + * @since 2.1
    */
   class EmptyCachedRepository implements CachedRepository {
       
  
  
  
  1.3       +5 -3      jakarta-commons/attributes/api/src/java/org/apache/commons/attributes/Indexed.java
  
  Index: Indexed.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/attributes/api/src/java/org/apache/commons/attributes/Indexed.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Indexed.java	12 Jul 2004 20:59:22 -0000	1.2
  +++ Indexed.java	27 Aug 2004 21:30:10 -0000	1.3
  @@ -22,9 +22,11 @@
    * run the attribute-indexer tool on the Jar-file containing the classes
    * you wish to find via the index.
    *
  - * <p><b>Note:</b> Indexed attributes that are inherited will not be found
  - * via an {@link AttributeIndex}. You will only find the class/method/field where
  - * the attribute is actually declared via the index.
  + * <p><b>Note regarding {@link Inheritable} attributes:</b> Indexed attributes 
  + * that are inherited will not be found via an {@link AttributeIndex}. You will 
  + * only find the class/method/field where the attribute is actually declared via the index.
  + *
  + * @since 2.1
    */
   public class Indexed {
   }
  
  
  
  1.2       +2 -0      jakarta-commons/attributes/api/src/java/org/apache/commons/attributes/Inheritable.java
  
  Index: Inheritable.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/attributes/api/src/java/org/apache/commons/attributes/Inheritable.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Inheritable.java	6 Jul 2004 20:41:46 -0000	1.1
  +++ Inheritable.java	27 Aug 2004 21:30:11 -0000	1.2
  @@ -19,6 +19,8 @@
    * This attribute is used to mark attributes as being inheritable.
    * Inheritable attributes are inherited down the class and interface
    * hierarchy.
  + *
  + * @since 2.1
    */
   public class Inheritable {
   }
  
  
  
  1.2       +18 -7     jakarta-commons/attributes/api/src/java/org/apache/commons/attributes/InvalidAttributeTargetError.java
  
  Index: InvalidAttributeTargetError.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/attributes/api/src/java/org/apache/commons/attributes/InvalidAttributeTargetError.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- InvalidAttributeTargetError.java	6 Jul 2004 20:41:46 -0000	1.1
  +++ InvalidAttributeTargetError.java	27 Aug 2004 21:30:11 -0000	1.2
  @@ -25,23 +25,34 @@
    * <p>For example:
    *
    * <pre><code>
  - * / **
  - *   * This attribute can only be applied to Classes.
  - *   * Target(Target.CLASS)
  - *   * /
  + * &#x2f;**
  + *  * This attribute can only be applied to Classes.
  + *  * Target(Target.CLASS)
  + *  *&#x2f;
    * public class MyAttribute {}
    *
    * public class MyClass {
  - *     / ** 
  + *     &#x2f;** 
    *       * Error: Can't apply MyAttribute to a field!
  - *       * MyAttribute() 
  - *       * /
  + *       * &#x40;&#x40;MyAttribute() 
  + *       *&#x2f;
    *     private String myField;
    * }
    * </code></pre>
  + *
  + * @since 2.1
    */
   public class InvalidAttributeTargetError extends Error {
       
  +    /**
  +     * Creates a new InvalidAttributeTargetError.
  +     *
  +     * @param attributeClass name of the type of the attribute that was applied to the wrong target.
  +     * @param element        the element that the user tried to apply the attribute to.
  +     * @param targetFlags    the targets (bitwise OR of the {@link Target}.XXX flags that the attributeClass
  +     *                       can be applied to.
  +     * @since 2.1
  +     */
       public InvalidAttributeTargetError (String attributeClass, String element, int targetFlags) {
           super ("Attributes of type " + attributeClass + " can't be applied to " + element + ". " + 
               "They can only be applied to: " + flagsToString (targetFlags));
  
  
  
  1.2       +10 -1     jakarta-commons/attributes/api/src/java/org/apache/commons/attributes/MultipleAttributesError.java
  
  Index: MultipleAttributesError.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/attributes/api/src/java/org/apache/commons/attributes/MultipleAttributesError.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MultipleAttributesError.java	6 Jul 2004 20:41:46 -0000	1.1
  +++ MultipleAttributesError.java	27 Aug 2004 21:30:11 -0000	1.2
  @@ -17,10 +17,19 @@
   
   /**
    * Thrown when one of the {@link Attributes}.getAttribute methods find more
  - * than one instance of the specified attribute class.
  + * than one instance of the specified attribute class and the method
  + * only expected to find a single instance.
  + *
  + * @since 2.1
    */
   public class MultipleAttributesError extends Error {
       
  +    /**
  +     * Create a new MultipleAttributesError. 
  +     *
  +     * @param clazz the name of the attribute class of which multiple instances were found.
  +     * @since 2.1    
  +     */
       public MultipleAttributesError (String clazz) {
           super ("There was more than one attribute of class " + clazz + " associated with the element.");
       }
  
  
  
  1.2       +43 -1     jakarta-commons/attributes/api/src/java/org/apache/commons/attributes/RepositoryError.java
  
  Index: RepositoryError.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/attributes/api/src/java/org/apache/commons/attributes/RepositoryError.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RepositoryError.java	6 Jul 2004 20:41:46 -0000	1.1
  +++ RepositoryError.java	27 Aug 2004 21:30:11 -0000	1.2
  @@ -18,29 +18,71 @@
   /**
    * Thrown when an attribute repository class can't be
    * loaded or instantiated.
  + *
  + * @since 2.1
    */
   public class RepositoryError extends Error {
  -   
  +    
       private final Throwable nested;
       
  +    /**
  +     * Create a new RepositoryError with no message or nested Throwable.
  +     *
  +     * @since 2.1
  +     */
       public RepositoryError () {
           this (null, null);
       }
       
  +    /**
  +     * Create a new RepositoryError with a message but no nested Throwable.
  +     * 
  +     * @param message the message.
  +     * @since 2.1
  +     */
       public RepositoryError (String message) {
           this (message, null);
       }
       
  +    /**
  +     * Create a new RepositoryError with a nested Throwable. The message is set to <code>nested.toString()</code>.
  +     * 
  +     * @param nested the nested Throwable.
  +     * @since 2.1
  +     */
       public RepositoryError (Throwable nested) {
           this (nested.toString(), nested);
       }
       
  +    /**
  +     * Create a new RepositoryError with a message and nested Throwable. 
  +     * 
  +     * @param message the message.
  +     * @param nested the nested Throwable.
  +     * @since 2.1
  +     */
       public RepositoryError (String message, Throwable nested) {
           super (message);
           this.nested = nested;
       }
       
  +    /**
  +     * Get the nested Throwable if any. 
  +     * 
  +     * @return the Throwable that caused this Error to be thrown, or <code>null</code> if none exists.
  +     * @since 2.1
  +     */
       public Throwable getNested () {
  +        return nested;
  +    }
  +    
  +    /**
  +     * Get the nested Throwable, if any.
  +     * 
  +     * @return the Throwable that caused this Error to be thrown, or <code>null</code> if none exists.
  +     * @since 2.2
  +     */
  +    public Throwable getCause () {
           return nested;
       }
   }
  
  
  
  1.2       +52 -7     jakarta-commons/attributes/api/src/java/org/apache/commons/attributes/RuntimeAttributeRepository.java
  
  Index: RuntimeAttributeRepository.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/attributes/api/src/java/org/apache/commons/attributes/RuntimeAttributeRepository.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RuntimeAttributeRepository.java	6 Jul 2004 20:41:53 -0000	1.1
  +++ RuntimeAttributeRepository.java	27 Aug 2004 21:30:11 -0000	1.2
  @@ -62,6 +62,8 @@
    *         }
    *     }
    * </code></pre>
  + *
  + * @since 2.1
    */
   public class RuntimeAttributeRepository implements AttributeRepositoryClass {
       
  @@ -69,25 +71,25 @@
        * Flag indicating whether this repository is modifiable.
        * Once sealed, a repository can't be un-sealed.
        */
  -    private boolean sealed = false;
  +    private volatile boolean sealed = false;
       
       /**
  -     * Set of class attributes. See javadoc for <code>AttributeRepositoryClass</code> for structure.
  +     * Set of class attributes. See javadoc for {@link AttributeRepositoryClass} for structure.
        */
       private final Set classAttributes = new HashSet ();
       
       /**
  -     * Set of field attributes. See javadoc for <code>AttributeRepositoryClass</code> for structure.
  +     * Set of field attributes. See javadoc for {@link AttributeRepositoryClass} for structure.
        */
       private final Map fieldAttributes = new HashMap ();
       
       /**
  -     * Set of ctor attributes. See javadoc for <code>AttributeRepositoryClass</code> for structure.
  +     * Set of ctor attributes. See javadoc for {@link AttributeRepositoryClass} for structure.
        */
       private final Map constructorAttributes = new HashMap ();
       
       /**
  -     * Set of method attributes. See javadoc for <code>AttributeRepositoryClass</code> for structure.
  +     * Set of method attributes. See javadoc for {@link AttributeRepositoryClass} for structure.
        */
       private final Map methodAttributes = new HashMap ();
       
  @@ -98,6 +100,8 @@
       
       /**
        * Create a new runtime repository.
  +     *
  +     * @since 2.1
        */
       public RuntimeAttributeRepository (Class clazz) {
           this.clazz = clazz;
  @@ -105,6 +109,8 @@
       
       /**
        * Adds a new attribute to the class itself.
  +     *
  +     * @since 2.1
        */
       public void addClassAttribute (Object attribute) {
           classAttributes.add (attribute);
  @@ -114,6 +120,8 @@
        * Convenience function to check if the repository is sealed.
        * 
        * @throws IllegalStateException if sealed
  +     *
  +     * @since 2.1
        */
       private void checkSealed () throws IllegalStateException {
           if (sealed) {
  @@ -124,6 +132,8 @@
       /**
        * Convenience method to get and initialize an enry in the method or
        * constructor attribute map.
  +     *
  +     * @since 2.1
        */
       private List getMethodOrConstructorAttributeBundle (Map map, String signature, int numSlots) {
           List bundle = (List) map.get (signature);
  @@ -142,8 +152,10 @@
       /**
        * Convenience method to get and initialize an entry in the method map.
        *
  -     * @return a fully initialized List (as defined for the <code>AttributeRepositoryClass</code> interface)
  +     * @return a fully initialized List (as defined for the {@link AttributeRepositoryClass} interface)
        *         for the given method.
  +     *
  +     * @since 2.1
        */
       private List getMethodAttributeBundle (Method m) {
           String signature = Util.getSignature (m);
  @@ -158,8 +170,10 @@
       /**
        * Convenience method to get and initialize an entry in the constructor map.
        *
  -     * @return a fully initialized List (as defined for the <code>AttributeRepositoryClass</code> interface)
  +     * @return a fully initialized List (as defined for the {@link AttributeRepositoryClass} interface)
        *         for the given constructor.
  +     *
  +     * @since 2.1
        */
       private List getConstructorAttributeBundle (Constructor c) {
           String signature = Util.getSignature (c);
  @@ -173,6 +187,8 @@
       
       /**
        * Adds an attribute to a field.
  +     *
  +     * @since 2.1
        */
       public void addFieldAttribute (String name, Object attribute) throws NoSuchFieldException, SecurityException {
           addFieldAttribute (clazz.getDeclaredField (name), attribute);
  @@ -180,6 +196,8 @@
       
       /**
        * Adds an attribute to a field.
  +     *
  +     * @since 2.1
        */
       public void addFieldAttribute (Field f, Object attribute) {
           checkSealed ();
  @@ -201,6 +219,8 @@
       /**
        * Adds an attribute to a constructor. The constructor is obtained via the getDeclaredConstrutor method 
        * of the class this repository defines.
  +     *
  +     * @since 2.1
        */
       public void addConstructorAttribute (Class[] parameters, Object attribute) throws NoSuchMethodException, SecurityException {
           addConstructorAttribute (clazz.getDeclaredConstructor (parameters), attribute);
  @@ -208,6 +228,8 @@
       
       /**
        * Adds an attribute to a constructor.
  +     *
  +     * @since 2.1
        */
       public void addConstructorAttribute (Constructor c, Object attribute) {
           checkSealed ();
  @@ -219,11 +241,18 @@
       /**
        * Adds an attribute to a method. The method is obtained via the getDeclaredMethod method 
        * of the class this repository defines.
  +     *
  +     * @since 2.1
        */
       public void addMethodAttribute (String name, Class[] parameters, Object attribute) throws NoSuchMethodException, SecurityException {
           addMethodAttribute (clazz.getDeclaredMethod (name, parameters), attribute);
       }
       
  +    /**
  +     * Adds an attribute to a method.
  +     *
  +     * @since 2.1
  +     */
       public void addMethodAttribute (Method m, Object attribute) {
           checkSealed ();
           List bundle = getMethodAttributeBundle (m);
  @@ -234,6 +263,8 @@
       /**
        * Adds an attribute to a parameter of a constructor. The constructor is obtained via the getDeclaredConstrutor method 
        * of the class this repository defines.
  +     *
  +     * @since 2.1
        */
       public void addParameterAttribute (Class[] parameters, int parameterIndex, Object attribute) throws NoSuchMethodException, SecurityException {
           addParameterAttribute (clazz.getDeclaredConstructor (parameters), parameterIndex, attribute);
  @@ -241,6 +272,8 @@
       
       /**
        * Adds an attribute to a parameter of a constructor. 
  +     *
  +     * @since 2.1
        */
       public void addParameterAttribute (Constructor c, int parameterIndex, Object attribute) {
           checkSealed ();
  @@ -254,6 +287,8 @@
       /**
        * Adds an attribute to a parameter of a method. The method is obtained via the getDeclaredMethod method 
        * of the class this repository defines.
  +     *
  +     * @since 2.1
        */
       public void addParameterAttribute (String name, Class[] parameters, int parameterIndex, Object attribute) throws NoSuchMethodException, SecurityException {
           addParameterAttribute (clazz.getDeclaredMethod (name, parameters), parameterIndex, attribute);
  @@ -262,6 +297,8 @@
       /**
        * Adds an attribute to a parameter of a method. The method is obtained via the getDeclaredMethod method 
        * of the class this repository defines.
  +     *
  +     * @since 2.1
        */
       public void addParameterAttribute (Method m, int parameterIndex, Object attribute) {
           checkSealed ();
  @@ -274,6 +311,8 @@
       /**
        * Adds an attribute to the return value of a method. The method is obtained via the getDeclaredMethod method 
        * of the class this repository defines.
  +     *
  +     * @since 2.1
        */
       public void addReturnAttribute (String name, Class[] parameters, Object attribute) throws NoSuchMethodException, SecurityException {
           addReturnAttribute (clazz.getDeclaredMethod (name, parameters), attribute);
  @@ -282,6 +321,8 @@
       /**
        * Adds an attribute to the return value of a method. The method is obtained via the getDeclaredMethod method 
        * of the class this repository defines.
  +     *
  +     * @since 2.1
        */
       public void addReturnAttribute (Method m, Object attribute) {
           checkSealed ();
  @@ -294,6 +335,8 @@
       
       /**
        * Gets the class this repository defines attributes for.
  +     *
  +     * @since 2.1
        */
       public Class getDefinedClass () {
           return clazz;
  @@ -317,6 +360,8 @@
       
       /**
        * Seals this repository. A sealed repository can't be modified.
  +     *
  +     * @since 2.1
        */
       public void seal () {
           sealed = true;
  
  
  
  1.2       +3 -0      jakarta-commons/attributes/api/src/java/org/apache/commons/attributes/Sealable.java
  
  Index: Sealable.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/attributes/api/src/java/org/apache/commons/attributes/Sealable.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Sealable.java	6 Jul 2004 20:41:53 -0000	1.1
  +++ Sealable.java	27 Aug 2004 21:30:11 -0000	1.2
  @@ -30,11 +30,14 @@
    * and of so, invoke {@link #seal()} on the attribute instance.
    * 
    * @see DefaultSealable
  + * @since 2.1
    */
   public interface Sealable {
       /**
        * Called to indicate that construction and initialization of this attribute instance
        * is completed, and that the attribute instance should become read-only.
  +     *
  + * @since 2.1
        */
       public void seal ();
   }
  
  
  
  1.2       +29 -6     jakarta-commons/attributes/api/src/java/org/apache/commons/attributes/Target.java
  
  Index: Target.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/attributes/api/src/java/org/apache/commons/attributes/Target.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Target.java	6 Jul 2004 20:41:53 -0000	1.1
  +++ Target.java	27 Aug 2004 21:30:11 -0000	1.2
  @@ -3,63 +3,83 @@
   /**
    * Attribute indicating what elements an attribute may be applied to.
    * This is checked at runtime. If the attribute is absent, it defaults
  - * to Target.ALL.
  + * to {@link Target#ALL Target.ALL}.
    *
    * <p>This attribute is intended to be used with attribute classes:
    * 
    * <pre><code>
  - * / **
  - *   * MyAttribute can only be applied to classes and fields, not methods.
  - *   * @@Target(Target.CLASS | Target.FIELD)
  - *   * /
  + * &#x2f;**
  + *  * MyAttribute can only be applied to classes and fields, not methods.
  + *  * &#x40;&#x40;Target(Target.CLASS | Target.FIELD)
  + *  *&#x2f;
    * public class MyAttribute { ... }
    * </code></pre>
  + *
  + * @since 2.1
    */
   public class Target {
       
       /**
        * Indicates that the attribute can be applied to a class or interface.
  +     *
  +     * @since 2.1
        */
       public static final int CLASS = 1;
       
       /**
        * Indicates that the attribute can be applied to a field.
  +     *
  +     * @since 2.1
        */
       public static final int FIELD = 2;
       
       /**
        * Indicates that the attribute can be applied to a method.
  +     *
  +     * @since 2.1
        */
       public static final int METHOD = 4;
       
       /**
        * Indicates that the attribute can be applied to a constructor.
  +     *
  +     * @since 2.1
        */
       public static final int CONSTRUCTOR = 8;
       
       /**
        * Indicates that the attribute can be applied to a method parameter.
  +     *
  +     * @since 2.1
        */
       public static final int METHOD_PARAMETER = 16;
       
       /**
        * Indicates that the attribute can be applied to a constructor parameter.
  +     *
  +     * @since 2.1
        */
       public static final int CONSTRUCTOR_PARAMETER = 32;
       
       /**
        * Indicates that the attribute can be applied to a method return value.
  +     *
  +     * @since 2.1
        */
       public static final int RETURN = 64;
       
       /**
        * Indicates that the attribute can be applied to a parameter of a method or a constructor.
        * It is equal to <code>METHOD_PARAMETER | CONSTRUCTOR_PARAMETER</code>.
  +     *
  +     * @since 2.1
        */
       public static final int PARAMETER = METHOD_PARAMETER | CONSTRUCTOR_PARAMETER;
       
       /**
        * Indicates that the attribute can be applied to any program element.
  +     *
  +     * @since 2.1
        */
       public static final int ALL = CLASS | FIELD | METHOD | CONSTRUCTOR | PARAMETER | RETURN;
       
  @@ -69,13 +89,16 @@
        * Creates a new target attribute.
        * 
        * @param flags a bitwise or of flags indicating the allowed targets.
  +     * @since 2.1
        */
       public Target (int flags) {
           this.flags = flags;
       }
       
       /**
  -     * Returns an int that is the bitwise or of the allowed target flags.
  +     * Returns an <code>int</code> that is the bitwise or of the allowed target flags.
  +     *
  +     * @since 2.1
        */
       public int getFlags () {
           return flags;
  
  
  
  1.5       +1 -1      jakarta-commons/attributes/compiler/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/attributes/compiler/project.xml,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- project.xml	26 Jul 2004 20:48:58 -0000	1.4
  +++ project.xml	27 Aug 2004 21:30:11 -0000	1.5
  @@ -50,7 +50,7 @@
           <dependency>
               <groupId>commons-attributes</groupId>
               <artifactId>commons-attributes-api</artifactId>
  -            <version>2.1</version>
  +            <version>2.2</version>
           </dependency>
           
           <dependency>
  
  
  
  1.2       +3 -0      jakarta-commons/attributes/compiler/src/java/org/apache/commons/attributes/validation/AttributeValidator.java
  
  Index: AttributeValidator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/attributes/compiler/src/java/org/apache/commons/attributes/validation/AttributeValidator.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AttributeValidator.java	6 Jul 2004 20:42:07 -0000	1.1
  +++ AttributeValidator.java	27 Aug 2004 21:30:11 -0000	1.2
  @@ -21,6 +21,8 @@
    * Validates that a set of classes have the correct attributes
    * attached to them. This interface must be implemented by the
    * validation rules given to the {@link AttributeValidatorTask}.
  + *
  + * @since 2.1
    */
   public interface AttributeValidator {
       
  @@ -30,6 +32,7 @@
        * @param classes the classes to validate.
        * @throws ValidationException if one or more classes have
        *         an invalid set of attributes.
  +     * @since 2.1
        */
       public void validate (Set classes) throws ValidationException;
   }
  
  
  
  1.2       +4 -0      jakarta-commons/attributes/compiler/src/java/org/apache/commons/attributes/validation/ValidationException.java
  
  Index: ValidationException.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/attributes/compiler/src/java/org/apache/commons/attributes/validation/ValidationException.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ValidationException.java	6 Jul 2004 20:42:09 -0000	1.1
  +++ ValidationException.java	27 Aug 2004 21:30:11 -0000	1.2
  @@ -18,6 +18,8 @@
   /**
    * Thrown by {@link AttributeValidator}s when an invalid set of
    * attributes are detected.
  + *
  + * @since 2.1
    */
   public class ValidationException extends Exception {
       
  @@ -29,6 +31,7 @@
        * @param invalidClass the class whose attributes are
        *                     invalid.
        * @param message a message describing why the attributes are invalid.
  + * @since 2.1
        */
       public ValidationException (Class invalidClass, String message) {
           super (message);
  @@ -38,6 +41,7 @@
       /**
        * Returns the class that triggered the ValidationExeption to
        * be thrown.
  + * @since 2.1
        */
       public Class getInvalidClass () {
           return invalidClass;
  
  
  
  1.5       +2 -2      jakarta-commons/attributes/plugin/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/attributes/plugin/project.xml,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- project.xml	26 Jul 2004 20:48:58 -0000	1.4
  +++ project.xml	27 Aug 2004 21:30:11 -0000	1.5
  @@ -31,13 +31,13 @@
           <dependency>
               <groupId>commons-attributes</groupId>
               <artifactId>commons-attributes-api</artifactId>
  -            <version>2.1</version>
  +            <version>2.2</version>
           </dependency>
           
           <dependency>
               <groupId>commons-attributes</groupId>
               <artifactId>commons-attributes-compiler</artifactId>
  -            <version>2.1</version>
  +            <version>2.2</version>
           </dependency>
           
           <dependency>
  
  
  
  1.5       +16 -0     jakarta-commons/attributes/site/xdocs/changelog.xml
  
  Index: changelog.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/attributes/site/xdocs/changelog.xml,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- changelog.xml	24 Jul 2004 14:32:28 -0000	1.4
  +++ changelog.xml	27 Aug 2004 21:30:11 -0000	1.5
  @@ -24,6 +24,22 @@
       </properties>
       
       <body>
  +        <section name="2004-08-26">
  +            <ul>
  +                <li>
  +                    <p>
  +                        Added <source>getCause()</source> to applicable Throwables, making them
  +                        compliant with the standard Java2 1.4 nested throwable spec.
  +                    </p>
  +                </li>
  +                <li>
  +                    <p>
  +                        CVS version number is now 2.2.
  +                    </p>
  +                </li>
  +            </ul>
  +        </section>
  +        
           <section name="2004-07-24">
               <ul>
                   <li>
  
  
  
  1.3       +43 -4     jakarta-commons/attributes/site/xdocs/faq.xml
  
  Index: faq.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/attributes/site/xdocs/faq.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- faq.xml	1 Aug 2004 20:17:59 -0000	1.2
  +++ faq.xml	27 Aug 2004 21:30:11 -0000	1.3
  @@ -26,12 +26,12 @@
       <body>
           <section name="Java 1.5 Annotations">
               
  -            <p><b>Q: How does Commons-Attributes fit in with the annotations in Java 1.5?</b></p>
  +            <p><b>Q: How does Commons-Attributes fit in with the annotations in Java 5.0?</b></p>
               
               <p>
                   <b>A:</b> With annotations we'll finally have a standard API for metadata in Java. The downside
  -                is that we have to switch to Java 1.5. Since people even now are still stuck with 
  -                Java 1.2 and Java 1.3, it may be a while before a project can require 1.5 and still 
  +                is that we have to switch to Java 5.0. Since people even now are still stuck with 
  +                Java 1.2 and Java 1.3, it may be a while before a project can require 5.0 and still 
                   have a reasonably-sized audience and/or usefulness.
               </p>
               
  @@ -41,7 +41,7 @@
               
               <p>
                   Ultimately this s a choice you must make based on your own preconditions, but this
  -                is my advice: You should switch to 1.5 if you can, given stability, compatibility 
  +                is my advice: You should switch to 5.0 if you can, given stability, compatibility 
                   et cetera. After all, it is the standard that people will use when it becomes the standard
                   (which it will). However, if you foresee that you'll stick with 1.4 or earlier and you 
                   think that metadata is the most cost-effective way of solving your problem, then
  @@ -108,6 +108,45 @@
               
           </section>
           
  +        <section name="Future Plans">
  +            
  +            <p><b>Q: What are the future plans for Commons-Attributes?</b></p>
  +            
  +            <p><b>A:</b> As indicated above, C-A isn't expected to live beyond widespread adoption
  +                of Java 5.0. But until then, the main area of concern is ease of use. Included in that
  +                are, in no particular order:</p>
  +            
  +            <ul>
  +                <li>
  +                    <p>Documentation: The existing code should be further documented, making it
  +                        easier to understand the package.</p>
  +                </li>
  +                <li>
  +                    <p>
  +                        Helpful code: Exceptions should go out of their way to help the developer 
  +                        find the bug by being precise and having relevant messages. Very often,
  +                        all a developer will have will be a stack trace in a logfile - let's make
  +                        that all they need as well.
  +                    </p>
  +                </li>
  +                <li>
  +                    <p>Standards compliance: The code should behave as expected in all Java
  +                        environments. For example, all Throwables that have a nested Throwable
  +                        should implement getCause(). This makes it easy for developers to deploy the
  +                        package in various environments.</p>
  +                </li>
  +                <li>
  +                    <p>No dependencies: The runtime API should have no dependencies, making upgrades
  +                        easy and painless.</p>
  +                </li>
  +                <li>
  +                    <p>Maximum backwards compatibility: Upgrading to the latest version of C-A should be
  +                        a no-brainer, not a carefully decided tradeoff between new features and
  +                        migration pain.</p>
  +                </li>
  +            </ul>
  +            
  +        </section>
           
       </body>
       
  
  
  
  1.5       +2 -2      jakarta-commons/attributes/unittest/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/attributes/unittest/project.xml,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- project.xml	1 Aug 2004 20:17:59 -0000	1.4
  +++ project.xml	27 Aug 2004 21:30:11 -0000	1.5
  @@ -55,13 +55,13 @@
           <dependency>
               <groupId>commons-attributes</groupId>
               <artifactId>commons-attributes-compiler</artifactId>
  -            <version>2.1</version>
  +            <version>2.2</version>
           </dependency>
           
           <dependency>
               <groupId>commons-attributes</groupId>
               <artifactId>commons-attributes-api</artifactId>
  -            <version>2.1</version>
  +            <version>2.2</version>
           </dependency>
       </dependencies>
       
  
  
  
  1.1                  jakarta-commons/attributes/unittest/project.properties
  
  Index: project.properties
  ===================================================================
  #   Copyright 2003-2004 The Apache Software Foundation
  #
  #   Licensed under the Apache License, Version 2.0 (the "License");
  #   you may not use this file except in compliance with the License.
  #   You may obtain a copy of the License at
  #
  #       http://www.apache.org/licenses/LICENSE-2.0
  #
  #   Unless required by applicable law or agreed to in writing, software
  #   distributed under the License is distributed on an "AS IS" BASIS,
  #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  #   See the License for the specific language governing permissions and
  #   limitations under the License.
  
  ######################################################################
  # Commons-Attributes
  ######################################################################
  org.apache.commons.attributes.enable=true
  org.apache.commons.attributes.index.enable=true
  
       
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message