You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "zhouyanming (JIRA)" <ji...@apache.org> on 2009/12/23 07:27:30 UTC
[jira] Created: (BEANUTILS-372) doesn't works with non-public inner
static class
doesn't works with non-public inner static class
-------------------------------------------------
Key: BEANUTILS-372
URL: https://issues.apache.org/jira/browse/BEANUTILS-372
Project: Commons BeanUtils
Issue Type: Bug
Affects Versions: 1.8.2
Reporter: zhouyanming
Priority: Blocker
if inner static class is not public,BeanUtils.copyProperties() doesn't works
import org.apache.commons.beanutils.BeanUtils;
public class Main {
public static void main(String[] args) throws Exception {
User u1 = new User();
User u2 = new User();
u1.setUsername("test");
BeanUtils.copyProperties(u2, u1);
System.out.println(u2.getUsername()); //here print null
}
static class User {
private String username;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
}
}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (BEANUTILS-372) doesn't works with non-public
inner static class
Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BEANUTILS-372?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Niall Pemberton resolved BEANUTILS-372.
---------------------------------------
Resolution: Invalid
This is the expected behaviour - BeanUtils only handles public classes.
BEANUTILS-18 is sort of related.
Closing as INVALID
> doesn't works with non-public inner static class
> -------------------------------------------------
>
> Key: BEANUTILS-372
> URL: https://issues.apache.org/jira/browse/BEANUTILS-372
> Project: Commons BeanUtils
> Issue Type: Bug
> Affects Versions: 1.8.2
> Reporter: zhouyanming
> Priority: Blocker
>
> if inner static class is not public,BeanUtils.copyProperties() doesn't works
> import org.apache.commons.beanutils.BeanUtils;
> public class Main {
> public static void main(String[] args) throws Exception {
> User u1 = new User();
> User u2 = new User();
> u1.setUsername("test");
> BeanUtils.copyProperties(u2, u1);
> System.out.println(u2.getUsername()); //here print null
> }
> static class User {
> private String username;
> public String getUsername() {
> return username;
> }
> public void setUsername(String username) {
> this.username = username;
> }
> }
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.