I would say that is a better style. Fixed.
xxxxxxxxxxxxxxxxxxxxxxxx
Scott Stark
Chief Technology Officer
JBoss Group, LLC
xxxxxxxxxxxxxxxxxxxxxxxx
----- Original Message -----
From: "Oleg Nitz" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, May 27, 2002 1:35 PM
Subject: [JBoss-dev] NPE use in TransactionImpl.java
> Hi!
>
> Here is a result of peer-review of TransactionImpl.java :)
> Look at this:
>
> public int getStatus()
> throws SystemException
> {
> try {
> return txCapsule.getStatus();
> } catch (NullPointerException ex) {
> return Status.STATUS_NO_TRANSACTION;
> }
> }
>
> NPE here is thrown quite often, at least I noticed this with JBoss 2.4.6
> Wouldn't it be better to code this in the following way?
>
> public int getStatus()
> throws SystemException
> {
> if (txCapsule != null) {
> return txCapsule.getStatus();
> } else {
> return Status.STATUS_NO_TRANSACTION;
> }
> }
>
> Regards,
> Oleg
>
> _______________________________________________________________
>
> Don't miss the 2002 Sprint PCS Application Developer's Conference
> August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm
>
> _______________________________________________
> Jboss-development mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-development
>
_______________________________________________________________
Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development