[Exmmt-commit] SF.net SVN: exmmt: [60] net.sourceforge.exmmt/trunk/src/java/net/sourceforge/exmmt/n
Status: Inactive
Brought to you by:
lgrammel
From: <lgr...@us...> - 2006-06-05 23:44:43
|
Revision: 60 Author: lgrammel Date: 2006-06-05 02:51:50 -0700 (Mon, 05 Jun 2006) ViewCVS: http://svn.sourceforge.net/exmmt/?rev=60&view=rev Log Message: ----------- #1500774 scenario "shopping list" Modified Paths: -------------- net.sourceforge.exmmt/trunk/src/java/net/sourceforge/exmmt/navigation/Focus.java Modified: net.sourceforge.exmmt/trunk/src/java/net/sourceforge/exmmt/navigation/Focus.java =================================================================== --- net.sourceforge.exmmt/trunk/src/java/net/sourceforge/exmmt/navigation/Focus.java 2006-06-05 09:48:47 UTC (rev 59) +++ net.sourceforge.exmmt/trunk/src/java/net/sourceforge/exmmt/navigation/Focus.java 2006-06-05 09:51:50 UTC (rev 60) @@ -51,9 +51,22 @@ int currentIndex = siblings.indexOf(focusedElement); - assert currentIndex != -1; + assert currentIndex >= 0; + assert currentIndex <= siblings.size() - 1; - focusedElement = siblings.get(currentIndex + 1); + int newIndex = currentIndex + 1; + + assert newIndex >= 1; + assert newIndex <= siblings.size(); + + if (newIndex == siblings.size()) { + newIndex = 0; + } + + assert newIndex >= 0; + assert newIndex <= siblings.size() - 1; + + focusedElement = siblings.get(newIndex); } } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |