ose 4.1.4 compilation issues

Discussions related to using VirtualBox on Linux hosts.
Post Reply
aidar
Posts: 2
Joined: 3. Nov 2011, 11:41
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: none

ose 4.1.4 compilation issues

Post by aidar »

Emerging VirtualBox 4.1.4 OSE on gentoo here,

it fails with:

Code: Select all

/var/tmp/portage/app-emulation/virtualbox-4.1.4/work/VirtualBox-4.1.4_OSE/out/linux.amd64/release/obj/vboxjxpcom-gen/jxpcomgen/java/glue/Helper.java:123: error: name clash: unwrap(List<Integer>) and unwrap(List<Short>) have the same erasure
    public static int[] unwrap(List<Integer> vals) {
                        ^
/var/tmp/portage/app-emulation/virtualbox-4.1.4/work/VirtualBox-4.1.4_OSE/out/linux.amd64/release/obj/vboxjxpcom-gen/jxpcomgen/java/glue/Helper.java:135: error: name clash: unwrap(List<Long>) and unwrap(List<Short>) have the same erasure
    public static long[] unwrap(List<Long> vals) {
                         ^
/var/tmp/portage/app-emulation/virtualbox-4.1.4/work/VirtualBox-4.1.4_OSE/out/linux.amd64/release/obj/vboxjxpcom-gen/jxpcomgen/java/glue/Helper.java:147: error: name clash: unwrap(List<Boolean>) and unwrap(List<Short>) have the same erasure
    public static boolean[] unwrap(List<Boolean> vals) {
                            ^
/var/tmp/portage/app-emulation/virtualbox-4.1.4/work/VirtualBox-4.1.4_OSE/out/linux.amd64/release/obj/vboxjxpcom-gen/jxpcomgen/java/glue/Helper.java:159: error: name clash: unwrap(List<String>) and unwrap(List<Short>) have the same erasure
    public static String[] unwrap(List<String> vals) {

indeed, the src/VBox/Main/glue/glue-java.xsl line 2656 has following, illegal java:

Code: Select all

    public static short[] unwrap(List<Short> vals) {
        if (vals==null)
           return null;

        short[] ret = new short[vals.size()];
        int i = 0;
        for (short l : vals) {
                ret[i++] = l;
        }
        return ret;
    }

    public static int[] unwrap(List<Integer> vals) {
        if (vals == null)
           return null;

        int[] ret = new int[vals.size()];
        int i = 0;
        for (int l : vals) {
                ret[i++] = l;
        }
        return ret;
    }

    public static long[] unwrap(List<Long> vals) {
        if (vals == null)
           return null;

        long[] ret = new long[vals.size()];
        int i = 0;
        for (long l : vals) {
                ret[i++] = l;
        }
        return ret;
    }
.
.
.
Some more generic methods with the exact same erasure.
Somebody is sane enough to fix this ?
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: ose 4.1.4 compilation issues

Post by Perryg »

I'm pretty sure the Gentoo people control their portage. See if this can help. http://www.gentoo.org/main/en/support.xml
MasterKGB
Posts: 52
Joined: 24. Jun 2011, 12:16
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: XP, Win7, Linux

Re: ose 4.1.4 compilation issues

Post by MasterKGB »

Yes they do ;)

From Gentoo Buglist https://bugs.gentoo.org/show_bug.cgi?id=387039

Try revdep-rebuild or comile without useflag Java
Check your jdk or recompile it

Maybe that Help
aidar
Posts: 2
Joined: 3. Nov 2011, 11:41
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: none

Re: ose 4.1.4 compilation issues

Post by aidar »

It is a nice to know there is a bug report in gentoo bugzilla, but that is not a gentoo issue at all ! that is something to do with people who write virtualbox, namely that piece of java is not legal java under any jvm > 1.5.0 according to Sun. It is clear violation of java language specification :
http://java.sun.com/docs/books/jls/thir ... asses.html
It is a compile-time error for the body of a class to declare as members two methods with override-equivalent signatures (§8.4.2) (name, number of parameters, and types of any parameters).
have reported a bug report here https://www.virtualbox.org/ticket/9848

So, please, leave comments like "this is xxx(gentoo,any other distribution) issue" out.
sergiomb
Posts: 21
Joined: 1. Dec 2011, 03:11
Primary OS: Fedora other
VBox Version: OSE Fedora
Guest OSses: windows Fedora rawhide

Re: ose 4.1.4 compilation issues

Post by sergiomb »

the fix is not difficult
just change unwrap(List<Integer> vals
to unwrapi
unwrap(List<long
to
unwrapl
an so on
and after that go to glue dir and when call unwarp see if should be unwrapi , unwrapl etc
Post Reply