From: <lh...@us...> - 2010-01-13 14:57:44
|
Revision: 363 http://tinytim.svn.sourceforge.net/tinytim/?rev=363&view=rev Author: lheuer Date: 2010-01-13 14:57:37 +0000 (Wed, 13 Jan 2010) Log Message: ----------- Fixes issue #2931353. Modified Paths: -------------- tinytim/trunk/CHANGES.txt tinytim/trunk/src/main/java/org/tinytim/internal/utils/CompactHashSet.java Modified: tinytim/trunk/CHANGES.txt =================================================================== --- tinytim/trunk/CHANGES.txt 2010-01-11 12:42:35 UTC (rev 362) +++ tinytim/trunk/CHANGES.txt 2010-01-13 14:57:37 UTC (rev 363) @@ -7,6 +7,9 @@ * Added support to convert XTM 1.0 class-instance relationships to TMDM type-instance relationships * Added support to convert XTM 1.0 PSIs to TMDM PSIs +* Moved to Ontopia's Compact(Hash|Identity)Set instead relying + on Java's default implementations +* Removed support for trove's collections Bugfixes: --------- Modified: tinytim/trunk/src/main/java/org/tinytim/internal/utils/CompactHashSet.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/internal/utils/CompactHashSet.java 2010-01-11 12:42:35 UTC (rev 362) +++ tinytim/trunk/src/main/java/org/tinytim/internal/utils/CompactHashSet.java 2010-01-13 14:57:37 UTC (rev 363) @@ -329,13 +329,14 @@ public Object next() { if (modCount != expectedModCount) throw new ConcurrentModificationException(); - if (index >= objects.length) { + int length = objects.length; + if (index >= length) { lastReturned = -2; throw new NoSuchElementException(); } lastReturned = index; - for (index += 1; index < objects.length && + for (index += 1; index < length && (objects[index] == null || objects[index] == deletedObject); index++) ; @@ -354,6 +355,8 @@ if (objects[lastReturned] != null && objects[lastReturned] != deletedObject) { objects[lastReturned] = deletedObject; elements--; + modCount++; + expectedModCount = modCount; // this is expected; we made the change } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |