Eclipse vs Javac difference
Benedict Elliott Smith
lists at laerad.com
Fri Aug 27 00:39:22 PDT 2010
This is something that bit me once - if you implement two
methods from different interfaces with the same erasure, the JDK6 compiler
barfs. It has definitely been fixed, but I think only in JDK7.
On 27 August 2010 01:11, Jonathan Gibbons <jonathan.gibbons at oracle.com>wrote:
> Stephen,
>
> Have you tried versions of JDK, such as OpenJDK 6 or OpenJDK 7?
>
> Can you boil the code down to a simple example which illustrates the
> different behavior?
>
> -- Jon
>
>
> On 08/26/2010 04:10 PM, Stephen Colebourne wrote:
>
>> I'm currently seeing a difference between Eclipse and Javac and am
>> trying to determine who is at fault, and how to work around it.
>>
>> The code in question is at Joda Primitives -
>>
>> http://joda-primitives.svn.sourceforge.net/viewvc/joda-primitives/trunk/JodaPrimitives/?pathrev=30
>>
>> Running maven - mvn package - shows the problem (it compiles in
>> Eclipse 3.5.0 and not in javac 1.6.0_13-b03)
>>
>>
>> \dev\joda\primitives\src\test\java\org\joda\primitives\list\impl\AbstractTestBooleanList.java:[76,39]
>> reference to iterator is ambiguous, both method iterator() in
>> org.joda.primitives.collection.BooleanCollection and method iterator()
>> in java.util.List<java.lang.Boolean> match
>>
>> The code includes an interface BooleanCollection that extends
>> interface PrimitiveCollection, which extends Collection<Boolean>. The
>> iterator() method is overridden covariantly in BooleanCollection to
>> return BooleanIterator, a subinterface of PrimitiveIterator<Boolean>
>> and Iterator<Boolean>.
>>
>> Any ideas? The svn repo is available to view (Apache 2 license).
>> Stephen
>>
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20100827/fd86c176/attachment.html
More information about the compiler-dev
mailing list