harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Ellison (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-6179) Inconsistent compiler behaviour for generics compared with Sun Java
Date Sun, 26 Apr 2009 20:03:30 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-6179?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12702929#action_12702929
] 

Tim Ellison commented on HARMONY-6179:
--------------------------------------

I compiled with Sun 1.5.0 build 16 (windows) and got:

c:\temp\sebb>"\java\Sun JDK 5.0\jdk1.5.0_16\bin\javac.exe" TestGeneric1.java TestGeneric2.java
TestGeneric3.java
TestGeneric2.java:4: inconvertible types
found   : T
required: java.lang.Integer
        if (v instanceof Integer) {
            ^
TestGeneric2.java:5: inconvertible types
found   : T
required: java.lang.Integer
           obj = Long.valueOf(((Integer) v).longValue());
                                         ^
TestGeneric3.java:4: inconvertible types
found   : T
required: java.lang.Integer
        if (v instanceof Integer) {
            ^
TestGeneric3.java:5: inconvertible types
found   : T
required: java.lang.Integer
           obj = Long.valueOf(((Integer) v).longValue());
                                         ^
4 errors


then compiled with Harmony r768582 (linux x86_64), which includes 
"Eclipse Java Compiler 0.894_R34x, 3.4.2 release"

and they all compiled without error using harmony,
tellison@minerva:~/sebb$ ~/harmony-jdk-768582/bin/javac -1.5 *.java
tellison@minerva:~/sebb$ ls -la
total 32
drwxr-xr-x  2 tellison tellison 4096 2009-04-26 13:13 .
drwxr-xr-x 10 tellison tellison 4096 2009-04-26 13:11 ..
-rw-r--r--  1 tellison tellison  760 2009-04-26 13:13 TestGeneric1.class
-rw-r--r--  1 tellison tellison  331 2009-04-26 13:12 TestGeneric1.java
-rw-r--r--  1 tellison tellison  763 2009-04-26 13:13 TestGeneric2.class
-rw-r--r--  1 tellison tellison  654 2009-04-26 13:12 TestGeneric2.java
-rw-r--r--  1 tellison tellison  763 2009-04-26 13:13 TestGeneric3.class
-rw-r--r--  1 tellison tellison  658 2009-04-26 13:12 TestGeneric3.java


> Inconsistent compiler behaviour for generics compared with Sun Java
> -------------------------------------------------------------------
>
>                 Key: HARMONY-6179
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6179
>             Project: Harmony
>          Issue Type: Bug
>          Components: JDK
>    Affects Versions: 5.0M9
>            Reporter: Sebb
>         Attachments: TestGeneric1.java, TestGeneric2.java, TestGeneric3.java
>
>
> The Harmony javac compiler seems to be rather more lenient than the Sun Java 1.5 compiler
with regard to how it handles some types of generics.
> See the attached samples. They all compile OK on Harmony.
> TestGeneric1.java - compiles OK on Sun
> TestGeneric2.java - 2 compilation errors on Sun
> TestGeneric3.java - 2 compilation errors on Sun
> See comments in the files which give the error output.

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


Mime
View raw message