[rfc][icedtea-web][patch] Patch to build icedtea-web 1.5.1 with java9

Fridrich Strba fridrich.strba at suse.com
Fri Oct 10 07:50:33 UTC 2014

Hash: SHA1

On 09/10/14 14:27, Jiri Vanek wrote:
> Thank you very much, foir contribution!  This is known issue - 
> https://bugzilla.redhat.com/show_bug.cgi?id=1095311 and The patch 
> itself is ok, however -does it still builds on 8? I doubt...:( So 
> the improvement, how to be buildable on both, have to be done.

Actually, I read the old implementation of class AppletImageRef. It
extends sun.misc.Ref in the old implementation and when one calls the
get(), one will thus get the sun.misc.Ref's get that returns Object
which we the downcast to Image. Since AppletImageRef is actually
sun.misc.Ref, it is safe to use it as return type and operate on it as
if it was just a sun.misc.Ref. The AppletImageRef does not overload
the get, so we will get the same version of get() for java < 1.9.0 as
with the original code that returns sun.misc.Ref.

For java 9, the get() is actually the AppletImageRef's get() that
returns Image instead of object. We are casting the return value of
the get into Image anyway, so there will not be any problem, just one
superfluous cast for the sake of backward compatibility.

Now, I don't have enough knowledge how this virtual function calls are
represented in the java bytecode, since for java < 1.9.0, it will be
the get() of super that will be called and for java >= 1.9.0 the get()
of the class itself. But from the point of view of source code, the
patch should be safe to apply and use.

I personally built icedtea-web-1.5.1 with it applied for java 8 and
the applets work like a charm.



P.S.: The Vector<?> -> Vector modifications did not cause building
against java8 or java7 to emit any error.

Version: GnuPG v2.0.22 (GNU/Linux)


More information about the distro-pkg-dev mailing list