fix BeanDesc bug

This commit is contained in:
Looly
2021-07-23 22:44:49 +08:00
parent 91047d1f88
commit 32797d2d14
3 changed files with 26 additions and 5 deletions

View File

@@ -12,6 +12,7 @@ import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.junit.Assert;
import org.junit.Test;
@@ -679,4 +680,24 @@ public class BeanUtilTest {
String childMotherName;
String childFatherName;
}
@Test
public void issueI41WKPTest(){
Test1 t1 = new Test1().setStrList(ListUtil.toList("list"));
Test2 t2_hu = new Test2();
BeanUtil.copyProperties(t1, t2_hu, CopyOptions.create().setIgnoreError(true));
Assert.assertNull(t2_hu.getStrList());
}
@Data
@Accessors(chain = true)
public static class Test1 {
private List<String> strList;
}
@Data
@Accessors(chain = true)
public static class Test2 {
private List<Integer> strList;
}
}