Thanks, I was originally using Collections.emptyIterator(), but that's only 
available in Java 7+. I'll do it your way, that sounds easier anyways. :) 

Dustin

On 10/19/2015 1:30 PM, Uwe Schindler wrote:
> Just unrelated to the original fix:
> 
> According to checks, the EmptyIterator should throw NoSuchElementException.
> But I would remove the impl completely! It is much simpler to just return 
> Collections.emptySet().iterator() when empty iterators are required; this is 
> also just returning a static singleton, so no speed improvement at all!
> 
> Uwe
> 
> -----
> Uwe Schindler
> H.-H.-Meier-Allee 63, D-28213 Bremen
> http://www.thetaphi.de
> eMail: u...@thetaphi.de
> 
> 
>> -----Original Message-----
>> From: virtu...@apache.org [mailto:virtu...@apache.org]
>> Sent: Monday, October 19, 2015 4:56 PM
>> To: comm...@poi.apache.org
>> Subject: svn commit: r1709427 -
>> /poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/Combi
>> nedIterable.java
>>
>> Author: virtuald
>> Date: Mon Oct 19 14:55:30 2015
>> New Revision: 1709427
>>
>> URL: http://svn.apache.org/viewvc?rev=1709427&view=rev
>> Log:
>> XDGF: fix jdk < 1.8 compat
>>
>> Modified:
>>
>> poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/Combin
>> edIterable.java
>>
>> Modified:
>> poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/Combin
>> edIterable.java
>> URL:
>> http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xd
>> gf/usermodel/section/CombinedIterable.java?rev=1709427&r1=1709426&r2
>> =1709427&view=diff
>> ==========================================================
>> ====================
>> ---
>> poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/Combin
>> edIterable.java (original)
>> +++
>> poi/trunk/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/Combi
>> +++ nedIterable.java Mon Oct 19 14:55:30 2015
>> @@ -17,7 +17,6 @@
>>
>>  package org.apache.poi.xdgf.usermodel.section;
>>
>> -import java.util.Collections;
>>  import java.util.Iterator;
>>  import java.util.Map.Entry;
>>  import java.util.NoSuchElementException; @@ -35,14 +34,21 @@ public
>> class CombinedIterable<T> impleme
>>
>>      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,
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: commits-unsubscr...@poi.apache.org
>> For additional commands, e-mail: commits-h...@poi.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
> For additional commands, e-mail: dev-h...@poi.apache.org
> 


-- 
Innovation is just a problem away

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to