You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by Dave Brosius <db...@mebigfatguy.com> on 2013/09/02 19:39:25 UTC

odd o.a.d.i.j.TransactionResourceImpl.isLoginException code

It appears that 
org.apache.derby.impl.jdbc.TransactionResourceImpl.isLoginException is 
perhaps missing an if

should

     private boolean isLoginException(Throwable thrownException) {
        if (thrownException instanceof StandardException) {
*((StandardException) 
thrownException).getSQLState().equals(SQLState.LOGIN_FAILED);*
            return true;
        }
        return false;
     }

be


     private boolean isLoginException(Throwable thrownException) {
        if (thrownException instanceof StandardException) {
*if ((StandardException) 
thrownException).getSQLState().equals(SQLState.LOGIN_FAILED)*
               return true;
        }
        return false;
     }


?

Re: odd o.a.d.i.j.TransactionResourceImpl.isLoginException code

Posted by Knut Anders Hatlen <kn...@oracle.com>.
Dave Brosius <db...@mebigfatguy.com> writes:

> It appears that
> org.apache.derby.impl.jdbc.TransactionResourceImpl.isLoginException is
> perhaps missing an if
>
> should
>
> private boolean isLoginException(Throwable thrownException) {
> if (thrownException instanceof StandardException) {
> ((StandardException) thrownException).getSQLState().equals
> (SQLState.LOGIN_FAILED);
> return true;
> }
> return false;
> }
>
> be
>
> private boolean isLoginException(Throwable thrownException) {
> if (thrownException instanceof StandardException) {
> if ((StandardException) thrownException).getSQLState().equals
> (SQLState.LOGIN_FAILED)
> return true;
> }
> return false;
> }
>
> ?

Good catch! It does indeed look like it was meant to be the latter. Will
you file a JIRA issue for it?

Thanks,


-- 
Knut Anders