On 11/25/2015 11:30 AM, Jörg Schaible wrote:
> Hi Thomas,
> 
> Thomas Neidhart wrote:
> 
>> On 11/24/2015 11:30 PM, Jörg Schaible wrote:
>>> Hi Thomas,
>>>
>>> Thomas Neidhart wrote:
> 
> [snip]
> 
>> These test failures exist since the 4.0 release, quoting your vote for
>> Collection 4.0 based on RC5:
>>
>>> +1, builds for all but one JDK flawlessly from source. I still have 2
>>> failing tests for IBM JDK 1.6:
>>>
>>> Failed tests:
>>>   
> AbstractMapTest$TestMapEntrySet.testMapEntrySetIteratorEntrySetValue:1656
>>> expected:<true> but was:<false>
>>>   
> AbstractMapTest$TestMapEntrySet.testMapEntrySetIteratorEntrySetValue:1656
>>> expected:<true> but was:<false>
>>>
>>> However, since we already blamed that JDK, it does not influence the
>>> release.
>>
>> I can not remember anymore why these have not been worked-around though,
>> but I suspect that it was not so simple in this case.
> 
> OK, at least it's no regression.
> 
>>> ================================ %< ===================
>>> $ mvn-3.0 -version
>>> Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19
>>> 14:51:28+0100)
>>> Maven home: /usr/share/maven-bin-3.0
>>> Java version: 1.6.0, vendor: IBM Corporation
>>> Java home: /opt/ibm-jdk-bin-1.6.0.9_p2/jre
>>> Default locale: en_US, platform encoding: UTF-8
>>> OS name: "linux", version: "4.1.12-gentoo", arch: "amd64", family: "unix"
>>> ================================ %< ===================
>>>
>>> It fails to compile with Java 8:
>>>
>>> ================================ %< ===================
>>> [INFO] -------------------------------------------------------------
>>> [ERROR] COMPILATION ERROR :
>>> [INFO] -------------------------------------------------------------
>>> [ERROR] /home/joehni/tmp/download/commons-collections4-4.1-
>>>
> src/src/test/java/org/apache/commons/collections4/FluentIterableTest.java:
>>> [242,41] reference to forEach is ambiguous
>>>   both method forEach(java.util.function.Consumer<? super T>) in
>>> java.lang.Iterable and method
>>> forEach(org.apache.commons.collections4.Closure<? super E>) in
>>> org.apache.commons.collections4.FluentIterable match
>>> [INFO] 1 error
>>> [INFO] -------------------------------------------------------------
>>
>> ok, this error has been already spotted by Oliver and fixed in trunk. It
>> is only in a test case where the type inference fails when passing a
>> null value to a method, as you usually do in tests.
> 
> OK, fine with me.
> 
> [snip]
> 
>>> nor Java 9:
>>
>> ok. I have to investigate these errors, but I really wonder what we
>> should do about it. Java 1.9 is not released yet, and these might be
>> compiler related bugs that will be fixed, and adding work-arounds for
>> things that perfectly compile with all previous Java versions does not
>> sound right.
> 
> I've update Java 9 now to the latest available (b93), but the problem stays. 
> However, we have the same errors with 4.0.0, so it's actually no regression, 
> but an indication that we need probably collections5 when Java 9 is final.

I did some further investigation into the compile errors with Java 9.

Some errors depend on the source/target version: they disappear for
version 1.8+ (there is at least one bugreport related to that:
https://bugs.openjdk.java.net/browse/JDK-8075793)

Some errors are not understandable at all:

Iterator<? extends E>[] iterators = new Iterator[others.length + 1];
iterators[0] = first.iterator();
for (int i = 0; i < others.length; i++) {
    iterators[i + 1] = others[i].iterator();
}
return IteratorUtils.zippingIterator(iterators);

The signature of IteratorUtils.zippingIterator is as follows:

public static <E> ZippingIterator<E> zippingIterator(final Iterator<?
extends E>... iterators)

it fails with:

[ERROR]
/home/tn/workspace/apache/commons-collections/src/main/java/org/apache/commons/collections4/IterableUtils.java:[554,36]
error: no suitable method found for zippingIterator(Iterator<? extends
E#1>[])


changing the call to

return IteratorUtils.<E>zippingIterator(iterators);

makes it pass.

Anyway, this will require some more time to investigate and fix. For a
4.1 release I will note that the project can not be compiled with Java 9
yet, and the next release (4.2) should improve on that imho.

Thanks for testing,

Thomas

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to