From 5d571fe3870a453277e2242efdc6373df8d8f719 Mon Sep 17 00:00:00 2001 From: Dustin Spicuzza Date: Mon, 19 Oct 2015 18:36:45 +0000 Subject: [PATCH] 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 --- build.xml | 4 +-- maven/poi-ooxml.pom | 2 +- .../usermodel/section/CombinedIterable.java | 29 +++++-------------- 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. - + + value="${repository.m2}/maven2/com/github/virtuald/curvesapi/1.03/curvesapi-1.03.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 @@ com.github.virtuald curvesapi - 1.02 + 1.03 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 implements Iterable { final SortedMap _baseItems; final SortedMap _masterItems; - - private static final class EmptyIterator implements Iterator { - - @Override - public boolean hasNext() { - return false; - } - - @Override - public T next() { - return null; - } - - @Override - public void remove() { - throw new UnsupportedOperationException(); - } - - } public CombinedIterable(SortedMap baseItems, SortedMap masterItems) { @@ -62,10 +45,12 @@ public class CombinedIterable implements Iterable { final Iterator> vmasterI; - if (_masterItems != null) + if (_masterItems != null) { vmasterI = _masterItems.entrySet().iterator(); - else - vmasterI = new EmptyIterator>(); + } else { + final Set> empty = Collections.emptySet(); + vmasterI = empty.iterator(); + } return new Iterator() {