Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.9.3
-
None
-
None
-
local test
Description
using below funtion copy beans, i have created two static inner class, but not copy successfully, then i have created two normal class, it's working fine.
under Spring's package, working fine.
package com;
import org.apache.commons.beanutils.BeanUtils;
//import org.springframework.beans.BeanUtils;
public class Test {
public static void main(String[] args) throws Exception
{ // TODO Auto-generated method stub Person person = new Person(); person.setAddress("Shannxi"); person.setName("Leo1"); Student student = new Student(); BeanUtils.copyProperties(student, person); System.out.println(student); //at firstly create two nomal class Employ and manager Employ employ = new Employ(); employ.setAddress("Shannxi xian"); employ.setName("Leo1"); Manager manager = new Manager(); BeanUtils.copyProperties(manager, employ); System.out.println(manager); }static class Person {
private String name;
private String address;
public String getName()
{ return name; }public void setName(String name) { this.name = name; }
public String getAddress() { return address; }
public void setAddress(String address) { this.address = address; }
}
static class Student {
private String name;
private String address;
public String getName() { return name; }
public void setName(String name)
{ this.name = name; }public String getAddress()
{ return address; }public void setAddress(String address)
{ this.address = address; }@Override
public String toString()
}
}