|
From: <lk...@us...> - 2004-11-16 09:04:38
|
Update of /cvsroot/openorb/PersistentStateService/src/main/org/openorb/pss/connector/memory In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2102/src/main/org/openorb/pss/connector/memory Modified Files: MemoryIterator.java Log Message: Fixed ArrayIndexOutOfBoundsException in MemoryIterator.detach() Index: MemoryIterator.java =================================================================== RCS file: /cvsroot/openorb/PersistentStateService/src/main/org/openorb/pss/connector/memory/MemoryIterator.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- MemoryIterator.java 10 Feb 2004 21:19:16 -0000 1.5 +++ MemoryIterator.java 16 Nov 2004 09:04:23 -0000 1.6 @@ -45,10 +45,7 @@ */ public boolean hasMoreElements() { - if ( _index < _incarnations.length ) - return true; - - return false; + return ( _index < _incarnations.length ); } /** @@ -75,7 +72,14 @@ */ public org.omg.CosPersistentState.StorageObject detach() { - return ( org.omg.CosPersistentState.StorageObject ) _incarnations[ _index ]; + if ( _index < _incarnations.length ) + { + return ( org.omg.CosPersistentState.StorageObject ) _incarnations[ _index ]; + } + else + { + return null; + } } /** |