You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by mr...@apache.org on 2005/03/08 06:40:16 UTC

cvs commit: xml-xerces/java/src/org/apache/xerces/impl/xs/models XSCMLeaf.java

mrglavas    2005/03/07 21:40:16

  Modified:    java/src/org/apache/xerces/impl/dtd/models CMAny.java
                        CMLeaf.java
               java/src/org/apache/xerces/parsers AbstractDOMParser.java
               java/src/org/apache/xerces/impl/dv/xs DurationDV.java
                        AbstractDateTimeDV.java
               java/src/org/apache/xerces/impl/xs/models XSCMLeaf.java
  Log:
  JIRA Issue #1046:
  http://issues.apache.org/jira/browse/XERCESJ-1046
  
  Cleaning up usage of toString() in miscellaneous places in the code. Patch thanks to Dave Brosius.
  
  Revision  Changes    Path
  1.6       +3 -3      xml-xerces/java/src/org/apache/xerces/impl/dtd/models/CMAny.java
  
  Index: CMAny.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/dtd/models/CMAny.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- CMAny.java	4 Oct 2004 22:00:42 -0000	1.5
  +++ CMAny.java	8 Mar 2005 05:40:15 -0000	1.6
  @@ -1,5 +1,5 @@
   /*
  - * Copyright 2000-2002,2004 The Apache Software Foundation.
  + * Copyright 2000-2002,2004,2005 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.
  @@ -114,7 +114,7 @@
               strRet.append
               (
                   " (Pos:"
  -                + new Integer(fPosition).toString()
  +                + Integer.toString(fPosition)
                   + ")"
               );
           }
  
  
  
  1.5       +3 -3      xml-xerces/java/src/org/apache/xerces/impl/dtd/models/CMLeaf.java
  
  Index: CMLeaf.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/dtd/models/CMLeaf.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- CMLeaf.java	4 Oct 2004 22:00:42 -0000	1.4
  +++ CMLeaf.java	8 Mar 2005 05:40:15 -0000	1.5
  @@ -1,5 +1,5 @@
   /*
  - * Copyright 1999-2002,2004 The Apache Software Foundation.
  + * Copyright 1999-2002,2004,2005 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.
  @@ -108,7 +108,7 @@
               strRet.append
               (
                   " (Pos:"
  -                + new Integer(fPosition).toString()
  +                + Integer.toString(fPosition)
                   + ")"
               );
           }
  
  
  
  1.114     +2 -2      xml-xerces/java/src/org/apache/xerces/parsers/AbstractDOMParser.java
  
  Index: AbstractDOMParser.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/parsers/AbstractDOMParser.java,v
  retrieving revision 1.113
  retrieving revision 1.114
  diff -u -r1.113 -r1.114
  --- AbstractDOMParser.java	24 Feb 2005 22:23:15 -0000	1.113
  +++ AbstractDOMParser.java	8 Mar 2005 05:40:16 -0000	1.114
  @@ -650,7 +650,7 @@
           if (fInDTD) {
               if (fInternalSubset != null && !fInDTDExternalSubset) {
                   fInternalSubset.append ("<?");
  -                fInternalSubset.append (target.toString ());
  +                fInternalSubset.append (target);
                   fInternalSubset.append (' ');
                   fInternalSubset.append (data.toString ());
                   fInternalSubset.append ("?>");
  
  
  
  1.18      +4 -4      xml-xerces/java/src/org/apache/xerces/impl/dv/xs/DurationDV.java
  
  Index: DurationDV.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/dv/xs/DurationDV.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- DurationDV.java	22 Feb 2005 19:32:30 -0000	1.17
  +++ DurationDV.java	8 Mar 2005 05:40:16 -0000	1.18
  @@ -1,5 +1,5 @@
   /*
  - * Copyright 1999-2002,2004, 2005 The Apache Software Foundation.
  + * Copyright 1999-2002,2004,2005 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.
  @@ -328,10 +328,10 @@
               if (ch == '.')
                   dot = i;
               else if (ch > '9' || ch < '0')
  -                throw new NumberFormatException("'"+buffer.toString()+"' has wrong format");
  +                throw new NumberFormatException("'" + buffer + "' has wrong format");
           }
           if (dot+1 == end) {
  -            throw new NumberFormatException("'"+buffer.toString()+"' has wrong format");
  +            throw new NumberFormatException("'" + buffer + "' has wrong format");
           }
           return Double.parseDouble(buffer.substring(start, end));
       }
  
  
  
  1.35      +11 -11    xml-xerces/java/src/org/apache/xerces/impl/dv/xs/AbstractDateTimeDV.java
  
  Index: AbstractDateTimeDV.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/dv/xs/AbstractDateTimeDV.java,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- AbstractDateTimeDV.java	3 Mar 2005 18:05:54 -0000	1.34
  +++ AbstractDateTimeDV.java	8 Mar 2005 05:40:16 -0000	1.35
  @@ -508,10 +508,10 @@
   		int i = start;
   		do {
   			digit = getDigit(buffer.charAt(i));
  -			if ( digit < 0 ) throw new NumberFormatException("'"+buffer.toString()+"' has wrong format");
  -			if ( result < multmin ) throw new NumberFormatException("'"+buffer.toString()+"' has wrong format");
  +			if ( digit < 0 ) throw new NumberFormatException("'" + buffer + "' has wrong format");
  +			if ( result < multmin ) throw new NumberFormatException("'" + buffer + "' has wrong format");
   			result *= radix;
  -			if ( result < limit + digit ) throw new NumberFormatException("'"+buffer.toString()+"' has wrong format");
  +			if ( result < limit + digit ) throw new NumberFormatException("'" + buffer + "' has wrong format");
   			result -= digit;
   			
   		}while ( ++i < end );
  @@ -541,17 +541,17 @@
   		while (i < end)
   		{
   			digit = getDigit(buffer.charAt(i++));
  -			if (digit < 0) throw new NumberFormatException("'"+buffer.toString()+"' has wrong format");
  -			if (result < multmin) throw new NumberFormatException("'"+buffer.toString()+"' has wrong format");
  +			if (digit < 0) throw new NumberFormatException("'" + buffer + "' has wrong format");
  +			if (result < multmin) throw new NumberFormatException("'" + buffer + "' has wrong format");
   			result *= radix;
  -			if (result < limit + digit) throw new NumberFormatException("'"+buffer.toString()+"' has wrong format");
  +			if (result < limit + digit) throw new NumberFormatException("'" + buffer + "' has wrong format");
   			result -= digit;
   		}
   		
   		if (negative)
   		{
   			if (i > 1) return result;
  -			else throw new NumberFormatException("'"+buffer.toString()+"' has wrong format");
  +			else throw new NumberFormatException("'" + buffer + "' has wrong format");
   		}
   		return -result;
   		
  @@ -782,14 +782,14 @@
   			if (ch == '.')
   				dot = i;
   			else if (ch > '9' || ch < '0')
  -				throw new NumberFormatException("'"+buffer.toString()+"' has wrong format");
  +				throw new NumberFormatException("'" + buffer + "' has wrong format");
   		}
   		if (dot == -1) {
   			if (start+2 != end)
  -				throw new NumberFormatException("'"+buffer.toString()+"' has wrong format");
  +				throw new NumberFormatException("'" + buffer + "' has wrong format");
   		}
   		else if (start+2 != dot || dot+1 == end) {
  -			throw new NumberFormatException("'"+buffer.toString()+"' has wrong format");
  +			throw new NumberFormatException("'" + buffer + "' has wrong format");
   		}
   		return Double.parseDouble(buffer.substring(start, end));
   	}
  
  
  
  1.8       +1 -1      xml-xerces/java/src/org/apache/xerces/impl/xs/models/XSCMLeaf.java
  
  Index: XSCMLeaf.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/models/XSCMLeaf.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- XSCMLeaf.java	6 Oct 2004 15:14:53 -0000	1.7
  +++ XSCMLeaf.java	8 Mar 2005 05:40:16 -0000	1.8
  @@ -100,7 +100,7 @@
               strRet.append
               (
                   " (Pos:"
  -                + new Integer(fPosition).toString()
  +                + Integer.toString(fPosition)
                   + ")"
               );
           }
  
  
  

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