VirtualBox

Opened 12 years ago

Closed 12 years ago

#9848 closed defect (fixed)

Compilation issues with Java glue (JDK 1.7.0) — at Version 5

Reported by: Aidar Owned by:
Component: other Version: VirtualBox 4.1.4
Keywords: glue-java.xsl java Cc:
Guest type: other Host type: Linux

Description (last modified by Frank Mehnert)

emerging 4.1.4 ose on gentoo here with following failure:

/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, src/VBox/Main/glue/glue-java.xsl on line 2656 has illegal java:

    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 which is illegal java. Any sane fix for this ? Am I missing something ?

Change History (5)

comment:1 by sergiomb, 12 years ago

I got same issue on Fedora rawhide, which chip Java 1.7
but no solution or patches appears to resolve this compile error, Just disable java or use java 1.6

comment:2 by sergiomb, 12 years ago

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

comment:3 by Frank Mehnert, 12 years ago

Summary: 4.1.4 compilation issues with java glueCompilation issues with Java glue (JDK 1.7.0)

Thanks for the hint. This should only apply to JDK 1.7.0.

comment:4 by Frank Mehnert, 12 years ago

Description: modified (diff)

comment:5 by Frank Mehnert, 12 years ago

Description: modified (diff)
Resolution: fixed
Status: newclosed

Fix in VBox 4.1.10.

Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use