commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Neidhart <thomas.neidh...@gmail.com>
Subject Re: svn commit: r1369292 - /commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/TestCollectionUtils.java
Date Sat, 04 Aug 2012 09:54:48 GMT
On 08/04/2012 11:26 AM, sebb wrote:
> On 4 August 2012 10:06,  <tn@apache.org> wrote:
>> Author: tn
>> Date: Sat Aug  4 09:06:21 2012
>> New Revision: 1369292
>>
>> URL: http://svn.apache.org/viewvc?rev=1369292&view=rev
>> Log:
>> Add javadoc comment to prevent removal of a generics fix.
>>
>> Modified:
>>     commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/TestCollectionUtils.java
>>
>> Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/TestCollectionUtils.java
>> URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/TestCollectionUtils.java?rev=1369292&r1=1369291&r2=1369292&view=diff
>> ==============================================================================
>> --- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/TestCollectionUtils.java
(original)
>> +++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/TestCollectionUtils.java
Sat Aug  4 09:06:21 2012
>> @@ -520,10 +520,11 @@ public class TestCollectionUtils extends
>>          Collection<List<? extends Number>> col = new ArrayList<List<?
extends Number>>();
>>          col.add(collectionA);
>>          col.add(collectionB);
>> -        Closure<List<? extends Number>> resultClosure = CollectionUtils.<List<?
extends Number>,Closure<List<? extends Number>>>forAllDo(col, testClosure);
>> +        Closure<List<? extends Number>> resultClosure = CollectionUtils.forAllDo(col,
testClosure);
>>          assertSame(testClosure, resultClosure);
>>          assertTrue(collectionA.isEmpty() && collectionB.isEmpty());
>> -        resultClosure = CollectionUtils.forAllDo(col, null);
>> +        // fix for various java 1.6 versions: keep the specialization
>> +        resultClosure = CollectionUtils.<List<? extends Number>,Closure<List<?
extends Number>>>forAllDo(col, null);
>>          assertNull(resultClosure);
>>          assertTrue(collectionA.isEmpty() && collectionB.isEmpty());
>>          resultClosure = CollectionUtils.forAllDo((Collection) null, testClosure);
>> @@ -542,6 +543,7 @@ public class TestCollectionUtils extends
>>          Closure<List<? extends Number>> resultClosure = CollectionUtils.forAllDo(col.iterator(),
testClosure);
>>          assertSame(testClosure, resultClosure);
>>          assertTrue(collectionA.isEmpty() && collectionB.isEmpty());
>> +        // fix for various java 1.6 versions: keep the specialization
> 
> Sorry, but what does that mean?

hmm, would be "force type erasure" better?

Certain java versions can not compile the following construct:

resultClosure = CollectionUtils.forAllDo(col, null);

when the return type is derived from a null argument parameter.

Thomas

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


Mime
View raw message