mirror of
https://gitee.com/dromara/hutool.git
synced 2026-02-09 09:16:26 +08:00
修复MultiResource游标歧义问题(issue#IDNAOY@Gitee)
This commit is contained in:
@@ -124,12 +124,12 @@ public class MultiResource implements Resource, Iterable<Resource>, Iterator<Res
|
||||
|
||||
@Override
|
||||
public boolean hasNext() {
|
||||
return cursor < resources.size();
|
||||
return getValidCursor() < resources.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized Resource next() {
|
||||
if (cursor >= resources.size()) {
|
||||
if (!hasNext()) {
|
||||
throw new ConcurrentModificationException();
|
||||
}
|
||||
this.cursor++;
|
||||
|
||||
@@ -284,10 +284,5 @@ class MultiResourceTest {
|
||||
public InputStream getStream() {
|
||||
return new ByteArrayInputStream(content.getBytes(StandardCharsets.UTF_8));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isModified() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user