axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@apache.org
Subject cvs commit: xml-axis/java/src/org/apache/axis Constants.java
Date Mon, 19 Aug 2002 03:23:24 GMT
rubys       2002/08/18 20:23:24

  Modified:    java/src/org/apache/axis Constants.java
  Log:
  Performance improvments, particularly when no attributes are present.
  
  Revision  Changes    Path
  1.83      +10 -4     xml-axis/java/src/org/apache/axis/Constants.java
  
  Index: Constants.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/Constants.java,v
  retrieving revision 1.82
  retrieving revision 1.83
  diff -u -r1.82 -r1.83
  --- Constants.java	18 Aug 2002 14:19:49 -0000	1.82
  +++ Constants.java	19 Aug 2002 03:23:23 -0000	1.83
  @@ -169,10 +169,14 @@
           if (attributes == null || search == null || localPart == null)
               return null;
   
  -        for (int i=0; i < search.length; i++) {
  -            String value = attributes.getValue(search[i], localPart);
  -            if (value != null) {
  -                return value;
  +        int len = attributes.getLength();
  +
  +        for (int i=0; i < len; i++) {
  +            if (attributes.getLocalName(i).equals(localPart)) {
  +                String uri = attributes.getURI(i);
  +                for (int j=0; j<search.length; j++) {
  +                    if (search[j].equals(uri)) return attributes.getValue(i);
  +                }
               }
           }
   
  @@ -191,6 +195,8 @@
                                     QName [] search) {
           if (attributes == null || search == null)
               return null;
  +
  +        if (attributes.getLength() == 0) return null;
   
           String value = null;
           for (int i=0; (value == null) && (i < search.length); i++) {
  
  
  

Mime
View raw message