commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benedikt Ritter <brit...@apache.org>
Subject Re: svn commit: r1645683 - in /commons/proper/dbutils/trunk/src: changes/changes.xml main/java/org/apache/commons/dbutils/AbstractQueryRunner.java
Date Tue, 16 Dec 2014 08:51:32 GMT
Is it possible to write a test for this change?

2014-12-15 17:13 GMT+01:00 <sebb@apache.org>:
>
> Author: sebb
> Date: Mon Dec 15 16:13:07 2014
> New Revision: 1645683
>
> URL: http://svn.apache.org/r1645683
> Log:
> DBUTILS-117 Error handling possible getParameterMetaData() results
>
> Modified:
>     commons/proper/dbutils/trunk/src/changes/changes.xml
>
> commons/proper/dbutils/trunk/src/main/java/org/apache/commons/dbutils/AbstractQueryRunner.java
>
> Modified: commons/proper/dbutils/trunk/src/changes/changes.xml
> URL:
> http://svn.apache.org/viewvc/commons/proper/dbutils/trunk/src/changes/changes.xml?rev=1645683&r1=1645682&r2=1645683&view=diff
>
> ==============================================================================
> --- commons/proper/dbutils/trunk/src/changes/changes.xml (original)
> +++ commons/proper/dbutils/trunk/src/changes/changes.xml Mon Dec 15
> 16:13:07 2014
> @@ -45,6 +45,10 @@ The <action> type attribute can be add,u
>    <body>
>
>      <release version="1.7" date="TBA" description="TBD">
> +      <action dev="sebb" type="update" issue="DBUTILS-117" due-to="Vadim
> Smirnov">
> +        Error handling possible getParameterMetaData() results
> +        - allow for null return
> +      </action>
>        <action dev="britter" type="update" issue="DBUTILS-117"
> due-to="Michael Akerman">
>          Correct errors in BeanMapHandler JavaDoc
>        </action>
>
> Modified:
> commons/proper/dbutils/trunk/src/main/java/org/apache/commons/dbutils/AbstractQueryRunner.java
> URL:
> http://svn.apache.org/viewvc/commons/proper/dbutils/trunk/src/main/java/org/apache/commons/dbutils/AbstractQueryRunner.java?rev=1645683&r1=1645682&r2=1645683&view=diff
>
> ==============================================================================
> ---
> commons/proper/dbutils/trunk/src/main/java/org/apache/commons/dbutils/AbstractQueryRunner.java
> (original)
> +++
> commons/proper/dbutils/trunk/src/main/java/org/apache/commons/dbutils/AbstractQueryRunner.java
> Mon Dec 15 16:13:07 2014
> @@ -223,12 +223,16 @@ public abstract class AbstractQueryRunne
>          ParameterMetaData pmd = null;
>          if (!pmdKnownBroken) {
>              pmd = stmt.getParameterMetaData();
> -            int stmtCount = pmd.getParameterCount();
> -            int paramsCount = params == null ? 0 : params.length;
> -
> -            if (stmtCount != paramsCount) {
> -                throw new SQLException("Wrong number of parameters:
> expected "
> -                        + stmtCount + ", was given " + paramsCount);
> +            if (pmd == null) { // can be returned by implementations that
> don't support the method
> +                pmdKnownBroken = true;
> +            } else {
> +                int stmtCount = pmd.getParameterCount();
> +                int paramsCount = params == null ? 0 : params.length;
> +
> +                if (stmtCount != paramsCount) {
> +                    throw new SQLException("Wrong number of parameters:
> expected "
> +                            + stmtCount + ", was given " + paramsCount);
> +                }
>              }
>          }
>
>
>
>

-- 
http://people.apache.org/~britter/
http://www.systemoutprintln.de/
http://twitter.com/BenediktRitter
http://github.com/britter

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message