Scarab commit: svn commit: r10160 - branches/release/b21/src/java/org/tigris/scarab/om/Transition.java

[email protected]
Newsgroups gmane.comp.java.scarab.cvs
Message-ID <[email protected]>
Author: dabbous
Date: 2006-06-11 00:58:08-0700
New Revision: 10160

Modified:
   branches/release/b21/src/java/org/tigris/scarab/om/Transition.java

Log:
fixed potential NPE problem related to toOptionId and fromOptionId
in Transition. Now getFromOptionId and getToOptionId always return
a valid Integer value. If an OptionId is NOT defined, the methods
return a Integer(0) instead, which is the empty transition. this may
be worng, to be checked.

Modified: branches/release/b21/src/java/org/tigris/scarab/om/Transition.java
Url: http://scarab.tigris.org/source/browse/scarab/branches/release/b21/src/java/org/tigris/scarab/om/Transition.java?view=diff&rev=10160&p1=branches/release/b21/src/java/org/tigris/scarab/om/Transition.java&p2=branches/release/b21/src/java/org/tigris/scarab/om/Transition.java&r1=10159&r2=10160
==============================================================================
--- branches/release/b21/src/java/org/tigris/scarab/om/Transition.java	(original)
+++ branches/release/b21/src/java/org/tigris/scarab/om/Transition.java	2006-06-11 00:58:08-0700
@@ -94,6 +94,31 @@
         }
         return role;
     }
+    
+    /**
+     * Get the FromOptionId
+     * Note: This method overwrites the generated base method.
+     * @return Integer
+     */
+    public Integer getFromOptionId()
+    {
+        Integer result = super.getFromOptionId();
+        if (result == null) result = new Integer(0);
+        return result;
+    }
+    
+    /**
+     * Get the ToOptionId
+     * Note: This method overwrites the generated base method.
+     * @return Integer
+     */
+    public Integer getToOptionId()
+    {
+        Integer result = super.getToOptionId();
+        if (result == null) result = new Integer(0);
+        return result;
+    }
+    
 
     public AttributeOption getFrom()
     {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.