Ubuntu

Incorrect generation/handling of generics compared to Sun javac?

Reported by James Page on 2011-02-11
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
openjdk-6 (Ubuntu)
Undecided
Unassigned

Bug Description

I'm currently packaging Jenkins (https://github.com/jenkinsci/jenkins/tree/jenkins-1_396 for a tarball) for Ubuntu and I've come across the following issue when compiling jenkins-core:

/home/jamespage/src/hudson/github/build-area/jenkins-1.396/core/src/main/java/hudson/model/Build.java:[80,16] types hudson.model.AbstractBuild<P,B> and hudson.model.AbstractBuild<P,B> are incompatible; both define getParent(), but with unrelated return types

/home/jamespage/src/hudson/github/build-area/jenkins-1.396/core/src/main/java/hudson/model/FreeStyleBuild.java:[35,7] types hudson.model.Build<hudson.model.FreeStyleProject,hudson.model.FreeStyleBuild> and hudson.model.Build<hudson.model.FreeStyleProject,hudson.model.FreeStyleBuild> are incompatible; both define getParent(), but with unrelated return types

This is on natty (OpenJDK version below).

java version "1.6.0_21"
OpenJDK Runtime Environment (IcedTea6 1.10pre) (6b21~pre1-0ubuntu2)
OpenJDK 64-Bit Server VM (build 19.0-b09, mixed mode)

Compiling with the Sun JDK from the partner repository works successfully.

I also get a similar issue on Maverick:

/home/jamespage/src/hudson/github/normal/jenkinsci-jenkins-653b030/core/src/main/java/hudson/model/Build.java:[80,16] types hudson.model.AbstractBuild<P,B> and hudson.model.AbstractBuild<P,B> are incompatible; both define getParent(), but with unrelated return types

/home/jamespage/src/hudson/github/normal/jenkinsci-jenkins-653b030/core/src/main/java/hudson/matrix/MatrixBuild.java:[60,7] types hudson.model.AbstractBuild<hudson.matrix.MatrixProject,hudson.matrix.MatrixBuild> and hudson.model.AbstractBuild<hudson.matrix.MatrixProject,hudson.matrix.MatrixBuild> are incompatible; both define getParent(), but with unrelated return types

/home/jamespage/src/hudson/github/normal/jenkinsci-jenkins-653b030/core/src/main/java/hudson/model/FreeStyleBuild.java:[35,7] types hudson.model.Build<hudson.model.FreeStyleProject,hudson.model.FreeStyleBuild> and hudson.model.Build<hudson.model.FreeStyleProject,hudson.model.FreeStyleBuild> are incompatible; both define getParent(), but with unrelated return types

This feels like a difference between the way the Sun JDK and OpenJDK handle generics.

Chris Cowan (agentme49) wrote :

Something that sounds like a similar issue: Under OpenJDK, when trying to compile https://github.com/sk89q/worldguard (commit 49bdccf020 currently), I get

[INFO] Compilation failure
/home/chris/Coding/bukkit/worldguard/src/main/java/com/sk89q/worldguard/protection/ApplicableRegionSet.java:[277,26] put(com.sk89q.worldguard.protection.regions.ProtectedRegion,V) in java.util.Map<com.sk89q.worldguard.protection.regions.ProtectedRegion,V> cannot be applied to (com.sk89q.worldguard.protection.regions.ProtectedRegion,java.lang.Object)

but with the Sun JDK this error doesn't happen.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in openjdk-6 (Ubuntu):
status: New → Confirmed
Christian Reis (kiko) wrote :

Does this issue also occur with the openjdk-7 packages?

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers