aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDustin Spicuzza <virtuald@apache.org>2015-10-19 18:36:45 +0000
committerDustin Spicuzza <virtuald@apache.org>2015-10-19 18:36:45 +0000
commit5d571fe3870a453277e2242efdc6373df8d8f719 (patch)
tree5b2ca97671ddda3b9b8d701b01db6e3e3ad94aaf
parentf5329e5b42604ac6ca958ff910ff36cca7650b57 (diff)
downloadpoi-5d571fe3870a453277e2242efdc6373df8d8f719.tar.gz
poi-5d571fe3870a453277e2242efdc6373df8d8f719.zip
XDGF: fix the fix
- Use Collections.emptySet() for an iterator instead - Bump curvesapi to 1.03, which is compiled for JDK 1.5 git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1709463 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--build.xml4
-rw-r--r--maven/poi-ooxml.pom2
-rw-r--r--src/ooxml/java/org/apache/poi/xdgf/usermodel/section/CombinedIterable.java29
3 files changed, 10 insertions, 25 deletions
diff --git a/build.xml b/build.xml
index 43c580e4e9..b022403a0f 100644
--- a/build.xml
+++ b/build.xml
@@ -177,9 +177,9 @@ under the License.
<property name="dsig.sl4j-api.url" value="${repository.m2}/maven2/org/slf4j/slf4j-api/1.7.7/slf4j-api-1.7.7.jar"/>
<!-- jars in the lib-ooxml directory, see the fetch-ooxml-jars target-->
- <property name="ooxml.curvesapi.jar" location="${ooxml.lib}/curvesapi-1.02.jar"/>
+ <property name="ooxml.curvesapi.jar" location="${ooxml.lib}/curvesapi-1.03.jar"/>
<property name="ooxml.curvesapi.url"
- value="${repository.m2}/maven2/com/github/virtuald/curvesapi/1.02/curvesapi-1.02.jar"/>
+ value="${repository.m2}/maven2/com/github/virtuald/curvesapi/1.03/curvesapi-1.03.jar"/>
<property name="ooxml.xmlbeans23.jar" location="${ooxml.lib}/xmlbeans-2.3.0.jar"/>
<property name="ooxml.xmlbeans23.url"
value="${repository.m2}/maven2/org/apache/xmlbeans/xmlbeans/2.3.0/xmlbeans-2.3.0.jar"/>
diff --git a/maven/poi-ooxml.pom b/maven/poi-ooxml.pom
index 5850def217..641934693f 100644
--- a/maven/poi-ooxml.pom
+++ b/maven/poi-ooxml.pom
@@ -72,7 +72,7 @@
<dependency>
<groupId>com.github.virtuald</groupId>
<artifactId>curvesapi</artifactId>
- <version>1.02</version>
+ <version>1.03</version>
</dependency>
</dependencies>
</project>
diff --git a/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/CombinedIterable.java b/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/CombinedIterable.java
index e5cb8144ca..bca48bc096 100644
--- a/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/CombinedIterable.java
+++ b/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/CombinedIterable.java
@@ -17,9 +17,11 @@
package org.apache.poi.xdgf.usermodel.section;
+import java.util.Collections;
import java.util.Iterator;
import java.util.Map.Entry;
import java.util.NoSuchElementException;
+import java.util.Set;
import java.util.SortedMap;
/**
@@ -31,25 +33,6 @@ public class CombinedIterable<T> implements Iterable<T> {
final SortedMap<Long, T> _baseItems;
final SortedMap<Long, T> _masterItems;
-
- private static final class EmptyIterator<T> implements Iterator<T> {
-
- @Override
- public boolean hasNext() {
- return false;
- }
-
- @Override
- public T next() {
- return null;
- }
-
- @Override
- public void remove() {
- throw new UnsupportedOperationException();
- }
-
- }
public CombinedIterable(SortedMap<Long, T> baseItems,
SortedMap<Long, T> masterItems) {
@@ -62,10 +45,12 @@ public class CombinedIterable<T> implements Iterable<T> {
final Iterator<Entry<Long, T>> vmasterI;
- if (_masterItems != null)
+ if (_masterItems != null) {
vmasterI = _masterItems.entrySet().iterator();
- else
- vmasterI = new EmptyIterator<Entry<Long, T>>();
+ } else {
+ final Set<Entry<Long, T>> empty = Collections.emptySet();
+ vmasterI = empty.iterator();
+ }
return new Iterator<T>() {