harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Doug Cutting (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-5807) [tools][javac] can't 'implement Delayed' compatibly with Sun Java
Date Wed, 07 May 2008 16:07:02 GMT

     [ https://issues.apache.org/jira/browse/HARMONY-5807?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Doug Cutting updated HARMONY-5807:

    Attachment: DelayedImpl.java

Here's a file that won't compile for me under Harmony, but that does compile for me under
Sun Java.  With JAVA_HOME unset, I see:

% ~/local/harmony-jdk-629320/bin/javac -source 1.5 DelayedImpl.java
1. ERROR in DelayedImpl.java (at line 3)
	public class DelayedImpl implements Delayed {
The type DelayedImpl must implement the inherited abstract method Comparable.compareTo(Object)
1 problem (1 error)

If I implement .compareTo(Object), then it won't compile under Sun Java.

> [tools][javac] can't 'implement Delayed' compatibly with Sun Java
> -----------------------------------------------------------------
>                 Key: HARMONY-5807
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5807
>             Project: Harmony
>          Issue Type: Bug
>          Components: JDK
>    Affects Versions: 5.0M5
>            Reporter: Doug Cutting
>         Attachments: DelayedImpl.java
> In HADOOP-3262 I tried to get Hadoop to compile under Harmony, and ran into a problem.
> I can't find a way to get a class that 'implements Delayed' to compile in both Sun Java
and Harmony.
> Given:
> public interface Comparable<T> {
>   int compareTo(T o);
> }
> public interface Delayed extends Comparable<Delayed> {}
> What is the correct signature for compareTo() in a Delayed implementation.  Harmony requires
the first of the following methods, and doesn't mind the second, while Sun permits only the
> public class DelayedImpl implements Delayed {
>   public int compareTo(Object o);
>   public int compareTo(Delayed o);
> }
> My guess is that Sun is correct and that this is a bug in Harmony.  Is that right?

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message