Merge pull request #23 from bigbear3001/master
Fix StackOverflowExcpetion for large Lists
This commit is contained in:
commit
b0efe8a283
5
.gitignore
vendored
5
.gitignore
vendored
@ -13,3 +13,8 @@ target/**
|
||||
# the local maven repository #
|
||||
mvn-local-repo/**/*
|
||||
release.properties
|
||||
/.classpath
|
||||
/.project
|
||||
/.settings/org.eclipse.core.resources.prefs
|
||||
/.settings/org.eclipse.jdt.core.prefs
|
||||
/.settings/org.eclipse.m2e.core.prefs
|
||||
|
@ -88,9 +88,10 @@ public class ConcurrentSet<T> implements Iterable<T>{
|
||||
|
||||
public boolean hasNext() {
|
||||
if (current == null) return false;
|
||||
T value = current.getValue();
|
||||
if (value == null) { // auto-removal of orphan references
|
||||
if (current.getValue() == null) { // auto-removal of orphan references
|
||||
do {
|
||||
remove();
|
||||
} while(current != null && current.getValue() == null);
|
||||
return hasNext();
|
||||
} else {
|
||||
return true;
|
||||
@ -101,7 +102,9 @@ public class ConcurrentSet<T> implements Iterable<T>{
|
||||
if (current == null) return null;
|
||||
T value = current.getValue();
|
||||
if (value == null) { // auto-removal of orphan references
|
||||
do {
|
||||
remove();
|
||||
} while(current != null && current.getValue() == null);
|
||||
return next();
|
||||
} else {
|
||||
current = current.next();
|
||||
|
Loading…
Reference in New Issue
Block a user