harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Beyer" <nbe...@kc.rr.com>
Subject RE: svn commit: r413531 - /incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/FeatureDescriptor.java
Date Mon, 12 Jun 2006 02:54:14 GMT
You beat me to this update by hours -- I was holding off because I noticed
that FeatureDescriptorTest was currently an excluded test and got dragged
into that for a bit. In any case, my patch was slightly different. Instead
of using a Vector, I just used the 'enumeration' utility method on
Collections. Like this:

    public Enumeration<String> attributeNames() {
        return Collections.enumeration(values.keySet());
    }

The functionality is obviously equivalent. I just thought I'd comment on the
alternative.

-Nathan

> -----Original Message-----
> From: tellison@apache.org [mailto:tellison@apache.org]
> Sent: Sunday, June 11, 2006 4:16 PM
> To: harmony-commits@incubator.apache.org
> Subject: svn commit: r413531 -
> /incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/jav
> a/beans/FeatureDescriptor.java
> 
> Author: tellison
> Date: Sun Jun 11 14:15:43 2006
> New Revision: 413531
> 
> URL: http://svn.apache.org/viewvc?rev=413531&view=rev
> Log:
> Convert attributeNames to return an enum of strings.
> 
> Modified:
> 
> incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java
> /beans/FeatureDescriptor.java
> 
> Modified:
> incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java
> /beans/FeatureDescriptor.java
> URL:
> http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/mod
> ules/beans/src/main/java/java/beans/FeatureDescriptor.java?rev=413531&r1=4
> 13530&r2=413531&view=diff
> ==========================================================================
> ====
> ---
> incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java
> /beans/FeatureDescriptor.java (original)
> +++
> incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java
> /beans/FeatureDescriptor.java Sun Jun 11 14:15:43 2006
> @@ -24,6 +24,7 @@
>  import java.util.Enumeration;
>  import java.util.Iterator;
>  import java.util.StringTokenizer;
> +import java.util.Vector;
> 
>  /**
>   * @author Maxim V. Berkultsev
> @@ -70,18 +71,10 @@
>      /**
>       * @com.intel.drl.spec_ref
>       */
> -    public Enumeration attributeNames() {
> -        String attributeNamesStr = "";
> -        Iterator i = values.keySet().iterator();
> -        while(i.hasNext()) {
> -            String attributeName = (String) i.next();
> -            if(attributeNamesStr.equals("")) {
> -                attributeNamesStr += attributeName;
> -            } else {
> -                attributeNamesStr += ' ' + attributeName;
> -            }
> -        }
> -        return new StringTokenizer(attributeNamesStr);
> +    public Enumeration<String> attributeNames() {
> +        Vector<String> attribNames = new Vector<String>(values.size());
> +        attribNames.addAll(values.keySet());
> +        return attribNames.elements();
>      }
> 
>      /**


---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Mime
View raw message