java-decompiler / jd-core

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

Local var type is chosen without checking if it matches further usage #31

Open Marcono1234 opened 4 years ago

Marcono1234 commented 4 years ago

Version

1.1.3+, Commit 7f01508 Compiler: javac 11.0.5

Description

It appears the local var type is chosen without checking if it matches further usage. Might be the same as #25.

Source:

class Test {
    void useInt(int i) { }

    void testVarType() {
        int i = 1;
        useInt(i);
    }
}

Decompiled output:

class Test {
    void useInt(int paramInt) {}

    void testVarType() {
        boolean bool = true;
        useInt(bool);
    }
}