Hibernate 3.5.4 doesn't build with OpenJDK 6b18-1.8.2 or greater

Description

Hi,

In the BTS of Debian it was reported[1] that Hibernate 3.5.4 can not be built with recent versions of OpenJDK6.

The compilation fails with a message similar to this one:

[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------ [INFO] Compilation failure
/build/user-libhibernate3-java_3.5.4.Final-4-amd64-X7BsRy/libhibernate3-java-3.5.4.Final/entitymanager/src/main/java/org/hibernate/ejb/criteria/path/AbstractPathImpl.java:[194,39] invalid inferred types for M; inferred type does not conform to declared bound(s)
inferred: java.util.Map<K,V>
bound(s): java.util.Map<capture#829 of ?,capture#332 of ?>

This is due to more strict type inference checks in OpenJDK6 1.8.2 and greater.
Debian is going to release a stable version of their distribution soon with OpenJDK6 1.8.3, so it's required to be able to compile Hibernate with that JDK version.

Any help to fix this problem is very welcomed.
The full build log is attached.

Thanks,

1. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=606295

Environment

Linux fiona 2.6.32-5-amd64 #1 SMP Thu Nov 25 18:02:11 UTC 2010 x86_64 GNU/Linux

java version "1.6.0_18"
OpenJDK Runtime Environment (IcedTea6 1.8.3) (6b18-1.8.3-2)
OpenJDK 64-Bit Server VM (build 16.0-b13, mixed mode)

Activity

Show:
Miguel Landaeta
December 13, 2010, 11:46 PM

I will ask in the Debian Java team if somebody could come up with a patch. I'm nowhere familiar with Hibernate internals so I can't provide that.

Damien Raude-Morvan
December 29, 2010, 12:34 AM

Tentative patch to fix this FTBFS of Hibernate with latest Oracle/OpenJDK

Damien Raude-Morvan
December 29, 2010, 12:42 AM

FYI, modified source code doesn't imply any change in generated bytecode (ie. type erasure is applied to those generics)

Just in case I've computed md5sum of each version :
f2845bd05c7d5f1961af5e53b12616db AbstractPathImpl.class.fixed
f2845bd05c7d5f1961af5e53b12616db AbstractPathImpl.class.orig

[
fixed had 0004-strict-type-inference-with-generics-code.patch applied
orig is .class file from extracted from repository.jboss.org/nexus/
]

Strong Liu
August 20, 2011, 5:00 AM

patch applied, thanks

Brett Meyer
March 7, 2014, 10:09 PM

Bulk closing tickets resolved in released versions

Assignee

Strong Liu

Reporter

Miguel Landaeta

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Priority

Major
Configure