java-decompiler / jd-core

JD-Core is a JAVA decompiler written in JAVA.
GNU General Public License v3.0
530 stars 135 forks source link

Cast is not added when overloading method with array parameter exists #33

Closed Marcono1234 closed 4 years ago

Marcono1234 commented 4 years ago

Version

1.1.3+, Commit 7f01508

Compiler

javac 11.0.5

Description

When an overloading method with array parameter exists and an overload with parameter type Object is called with an array, the required cast is not added.

Source:

class ArrayMethodOverloading {
    void use(Object[] o) { }
    void use(Object o) { }

    void test() {
        use((Object) new Object[] {""});
    }
}

Decompiled output:

class ArrayMethodOverloading {
    void use(Object[] paramArrayOfObject) {}

    void use(Object paramObject) {}

    void test() {
        use(new Object[] { "" });
    }
}