commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: svn commit: r883394 - /commons/proper/dbcp/trunk/src/java/org/apache/commons/jocl/JOCLContentHandler.java
Date Mon, 23 Nov 2009 17:12:52 GMT
On 23/11/2009, Phil Steitz <phil.steitz@gmail.com> wrote:
> Phil Steitz wrote:
>  > sebb@apache.org wrote:
>  >> Author: sebb
>  >> Date: Mon Nov 23 16:18:50 2009
>  >> New Revision: 883394
>  >>
>  >> URL: http://svn.apache.org/viewvc?rev=883394&view=rev
>  >> Log:
>  >> Boolean.valueOf() is better than new Boolean()
>  >
>  > Is this available in 1.4?  I thought I checked and saw no.  Could be
>  > this one is and others are not.
>  >
>  > Phil
>  >> Modified:
>  >>     commons/proper/dbcp/trunk/src/java/org/apache/commons/jocl/JOCLContentHandler.java
>  >>
>  >> Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/jocl/JOCLContentHandler.java
>  >> URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/jocl/JOCLContentHandler.java?rev=883394&r1=883393&r2=883394&view=diff
>  >> ==============================================================================
>  >> --- commons/proper/dbcp/trunk/src/java/org/apache/commons/jocl/JOCLContentHandler.java
(original)
>  >> +++ commons/proper/dbcp/trunk/src/java/org/apache/commons/jocl/JOCLContentHandler.java
Mon Nov 23 16:18:50 2009
>  >> @@ -439,7 +439,7 @@
>  >>                  } else if(ELT_BOOLEAN.equals(localName)) {
>  >>                      String valstr = getAttributeValue(ATT_VALUE,attr,"false");
>  >>                      boolean val = ("true".equalsIgnoreCase(valstr) || "yes".equalsIgnoreCase(valstr));
>  >> -                    addObject(Boolean.TYPE,new Boolean(val));
>  >> +                    addObject(Boolean.TYPE,Boolean.valueOf(val));
>  >>                  } else if(ELT_BYTE.equals(localName)) {
>  >>                      byte val = Byte.parseByte(getAttributeValue(ATT_VALUE,attr,"0"));
>  >>                      addObject(Byte.TYPE,new Byte(val));
>  >> @@ -478,7 +478,7 @@
>  >>                      // unrecognized JOCL element warning?
>  >>                  }
>  >>              }
>  >> -        } catch(Exception e) {
>  >> +        } catch(ClassNotFoundException e) {
>
>
> I see another change in here.  This will change behavior when
>  NumberFormatException is thrown above.  I guess its OK unless
>  clients are expecting and catching SAXException in this case.
>

Oops - I've added NumberFormatException.

>  >>              throw new SAXException(e);
>  >>          }
>  >>      }
>  >>
>  >>
>  >
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>  For additional commands, e-mail: dev-help@commons.apache.org
>
>

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


Mime
View raw message