podam icon indicating copy to clipboard operation
podam copied to clipboard

Issue with resolving parameters of generic types in constructor arguments

Open daivanov opened this issue 11 years ago • 1 comments

Hi,

There is an error in how PODAM resolves generic parameters of types in constructors. For example for this POJO it will produce two (or one list in case memoization is enabled) List instead of real types.

public class Pojo {

    private List<Long> list1;
    private List<String> list2;

    public GenericInConstructorPojo(List<Long> list1, List<String> list2) {
        this.list1 = list1;
        this.list2 = list2;
    }

    public Vector<Long> getList1() {
        return list1;
    }

    public Vector<String> getList2() {
        return list2;
    }
}

Best regards, Daniil

daivanov avatar Oct 01 '15 15:10 daivanov

This is not a bug. It works as expected: https://jemos.ci.cloudbees.com/job/podam-develop/351/console

Check two additional tests in the develop branch:

ConstructorUnitTest.podamShouldHandleGenericCollectionsInConstructorWithMemoizationDisabled

And

ConstructorUnitTest.podamShouldHandleGenericCollectionsInConstructorWithMemoizationEnabled

mtedone avatar Oct 03 '15 13:10 mtedone