InvalidPropertyException: bean class 无效 属性 'myListName[0]'

InvalidPropertyException: Invalid property 'myListName[0]' of bean class

虽然 运行 使用 Thymeleaf 并使用 Proguard 混淆的 Spring MVC 网络应用程序,但我 运行 遇到以下异常:

org.springframework.web.util.NestedServletException: 
Request processing failed; nested exception is 
org.springframework.beans.InvalidPropertyException: 
Invalid property 'listOfSomething[0]' of bean class ...

这在混淆之前工作得很好,但之后就坏了。

public class FormToSubmit {

    private List<MyType> listOfSomething;

    public List<MyType> getListOfSomething() {
        return listOfSomething;
    }

    public void setListOfSomething(List<MyType> listOfSomething) {
        this.listOfSomething = listOfSomething;
    }
}

在混淆过程中,我已经保留了所有 public 属性 访问器:

-keep public class com.package.name.model.** { *; }

原来列表的类型参数被混淆器删除了。将以下行添加到 proguard 配置中解决了这个问题。

-keepattributes Signature