gentyref project cannot be compiled with Sun JDK5 compiler

4 views
Skip to first unread message

Peter Niederwieser

unread,
Mar 26, 2010, 5:58:23 PM3/26/10
to gentyref
Just to let you know, I wasn't able to compile some of gentyref's
tests with Sun's JDK5 compiler (the compiler rejected some of the
weirder Generics stuff). It does compile with JDK6 though.

Cheers,
Peter

Wouter Coekaerts

unread,
Mar 26, 2010, 6:59:58 PM3/26/10
to gent...@googlegroups.com

The test classes include some code that tries to "prove" that (by
passing the type checks of the compiler) the thing they are testing is
correct.
For example, if a method tests that GenericTypeReflector can see that
X is a supertype of Y, it not only asserts the result of the
GenericTypeReflector call, it also creates variables of type X and Y,
and assigns them to eachother.
In other words, it checks that Gentyref's type checking agrees with
the compiler's type checking.

In some cases I've commented out the compiler-checking part when
either the JDK 6 compiler or my Eclipse won't compile it.
Or I've worked around them, like in the particularly tricky
AbstractGenericsReflectorTest.testUExtendsListOfExtT: holding the
compiler's hand step by step to show it one type is a supertype of
another.
But I have to draw the line somewhere, and JDK 5 (because of its bugs)
is on the wrong side of that line.

The advantage is that there's an extra insurance that it's doing the
right thing. The disadvantage is that it pushes the limits of the
compiler, and compiler bugs in the corner cases it tests cause the
tests not to compile. I find that a price worth paying.

I'd even say that exposing these shortcomings in compilers is an extra
feature of the tests ;-)

And to be clear nobody reading this misunderstands:
This does not mean the Gentyref library itself has any problems
(compiling or running) with JDK 5.
Even the tests should *run* fine with JDK 5, just not compile with it.

Thanks anyways for the heads up Peter,

Wouter.

Peter Niederwieser

unread,
May 24, 2010, 5:31:11 PM5/24/10
to gentyref
After updating to JDK 1.6.0_20 (Mac), I cannot run GentyRef's tests
anymore (strangely getting IncompatibleClassChangeError's for some
inner classes). Not a big issue for me, but I wanted to let you know.

Cheers,
Peter

On Mar 27, 12:59 am, Wouter Coekaerts <wou...@coekaerts.be> wrote:
--
You received this message because you are subscribed to the Google Groups "gentyref" group.
To post to this group, send email to gent...@googlegroups.com.
To unsubscribe from this group, send email to gentyref+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gentyref?hl=en.

Wouter Coekaerts

unread,
Dec 2, 2010, 2:20:33 PM12/2/10
to gent...@googlegroups.com
On Mon, May 24, 2010 at 11:31 PM, Peter Niederwieser <pnie...@gmail.com> wrote:
> After updating to JDK 1.6.0_20 (Mac), I cannot run GentyRef's tests
> anymore (strangely getting IncompatibleClassChangeError's for some
> inner classes). Not a big issue for me, but I wanted to let you know.

Looks like a compiler bug. I opened a bug for it at oracle:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7003595
And worked around it in gentyref.
(http://code.google.com/p/gentyref/issues/detail?id=15)

Regards,

Wouter.

Reply all
Reply to author
Forward
0 new messages