[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-848) TransactionPropagationType.isNewTransactionRequired() logic is incorrect for MANDATORY and NEVER

Gavin King (JIRA) jira-events at lists.jboss.org
Wed Feb 14 14:28:44 EST 2007


    [ http://jira.jboss.com/jira/browse/JBSEAM-848?page=comments#action_12353121 ] 
            
Gavin King commented on JBSEAM-848:
-----------------------------------

Ups, I always hated switch statements!

> TransactionPropagationType.isNewTransactionRequired() logic is incorrect for MANDATORY and NEVER
> ------------------------------------------------------------------------------------------------
>
>                 Key: JBSEAM-848
>                 URL: http://jira.jboss.com/jira/browse/JBSEAM-848
>             Project: JBoss Seam
>          Issue Type: Bug
>    Affects Versions: 1.1.6.GA
>         Environment: Any
>            Reporter: Mike Quilleash
>             Fix For: 1.1.7.GA
>
>
> The existing code looks like this...
>          case REQUIRED:
>             return !transactionActive;
>          case SUPPORTS:
>             return false;
>          case MANDATORY:
>             if ( !transactionActive )
>             {
>                throw new IllegalStateException("No transaction active on call to MANDATORY method");
>             }
>          case NEVER:
>             if ( transactionActive )
>             {
>                throw new IllegalStateException("Transaction active on call to NEVER method");
>             }
>          default:
>             throw new IllegalArgumentException();
> Will fall-through on the second two cases and throw an incorrect exception.  Probably needs just needs "return false" in both cases.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the seam-issues mailing list