You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Srinivas Vemula (JIRA)" <ji...@apache.org> on 2009/09/07 15:14:57 UTC

[jira] Created: (BEANUTILS-360) BeanUtils.copyProperties() method is not working in JDK1.6

BeanUtils.copyProperties() method is not working in JDK1.6
----------------------------------------------------------

                 Key: BEANUTILS-360
                 URL: https://issues.apache.org/jira/browse/BEANUTILS-360
             Project: Commons BeanUtils
          Issue Type: Wish
          Components: Bean / Property Utils
    Affects Versions: 1.7.0
         Environment: WebSphere Application Server v7.0.0.3 (WAS) , RAD7.5.3
            Reporter: Srinivas Vemula


we are using beanutils 1.7.0 version and the below code is not working as expected. as i mentioned we are using the WebSphere Application server v7.0.0.3 JDK. i.e, JDK1.6

code snippet:
interface GroupInterface :
------------------------------
package test.groups;
public interface GroupInterface {
	 public static final int ACTIVE 	= 1;
	  public static final int INACTIVE 	= 0;
	  public static final int DELETED 	= -1;
	  
	  public void setActivated(Integer value) ;
	  public Integer getActivated() ;
}

GRPinfo.java :
----------------------
package test.groups;
public class GRPInfo implements GroupInterface {

	private Integer activated;
		
	public void setActivated(int value) {
		setActivated(new Integer(value));
	}
	public void setActivated(Integer value) {
		this.activated = value;
	}
	public Integer getActivated() {
		return activated;
	}	
}

GRPTest.java :
---------------------
package test.groups;
import org.apache.commons.beanutils.BeanUtils;
public class GRPTest {

	public static void main(String[] args) throws Exception {
		
		GRPInfo src = new GRPInfo();		
		src.setActivated(GroupInterface.DELETED);
		
		GRPInfo dst = new GRPInfo();
		dst.setActivated(GroupInterface.ACTIVE);		
		
			System.out.println(" SRC Activated -->"+src.getActivated());
			BeanUtils.copyProperties(dst,src);
			System.out.println("DST Activated "+dst.getActivated());
	}
}


If i run the above sample application (GRPTest.java), the 'copyProperties()' is not actually copying the values from 'src' to 'dst'.
i can see the value 1 in the 'dst' object. this behavior is observed on WAS JDK1.6 but the same code is working fine on WAS JDK1.5

suspecting on two variants of setActivated() method. but the pointer here the same code is working fine on JDK1.5
is this a compliance problem with JDK1.6 with the BeanUtil.copyProperties() method?

-srinivas

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (BEANUTILS-360) BeanUtils.copyProperties() method is not working in JDK1.6

Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BEANUTILS-360?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12761204#action_12761204 ] 

Niall Pemberton commented on BEANUTILS-360:
-------------------------------------------

I can't reproduce this, it works OK for me on Sun's JDK 1.6.0_07 with both BeanUtils 1.7.0 and the current BeanUtils 1.8.0 release. Perhaps you could step through the BeanUtils code debugging what its actually doing to cause the issue. 

Also why have two setActivated() methods? Since with autoboxing you don't need both primitive and object method implementations. Also try removing the setActivated(int) from GRPinfo to see if that resolves the problem.

> BeanUtils.copyProperties() method is not working in JDK1.6
> ----------------------------------------------------------
>
>                 Key: BEANUTILS-360
>                 URL: https://issues.apache.org/jira/browse/BEANUTILS-360
>             Project: Commons BeanUtils
>          Issue Type: Wish
>          Components: Bean / Property Utils
>    Affects Versions: 1.7.0
>         Environment: WebSphere Application Server v7.0.0.3 (WAS) , RAD7.5.3
>            Reporter: Srinivas Vemula
>
> we are using beanutils 1.7.0 version and the below code is not working as expected. as i mentioned we are using the WebSphere Application server v7.0.0.3 JDK. i.e, JDK1.6
> code snippet:
> interface GroupInterface :
> ------------------------------
> package test.groups;
> public interface GroupInterface {
> 	 public static final int ACTIVE 	= 1;
> 	  public static final int INACTIVE 	= 0;
> 	  public static final int DELETED 	= -1;
> 	  
> 	  public void setActivated(Integer value) ;
> 	  public Integer getActivated() ;
> }
> GRPinfo.java :
> ----------------------
> package test.groups;
> public class GRPInfo implements GroupInterface {
> 	private Integer activated;
> 		
> 	public void setActivated(int value) {
> 		setActivated(new Integer(value));
> 	}
> 	public void setActivated(Integer value) {
> 		this.activated = value;
> 	}
> 	public Integer getActivated() {
> 		return activated;
> 	}	
> }
> GRPTest.java :
> ---------------------
> package test.groups;
> import org.apache.commons.beanutils.BeanUtils;
> public class GRPTest {
> 	public static void main(String[] args) throws Exception {
> 		
> 		GRPInfo src = new GRPInfo();		
> 		src.setActivated(GroupInterface.DELETED);
> 		
> 		GRPInfo dst = new GRPInfo();
> 		dst.setActivated(GroupInterface.ACTIVE);		
> 		
> 			System.out.println(" SRC Activated -->"+src.getActivated());
> 			BeanUtils.copyProperties(dst,src);
> 			System.out.println("DST Activated "+dst.getActivated());
> 	}
> }
> If i run the above sample application (GRPTest.java), the 'copyProperties()' is not actually copying the values from 'src' to 'dst'.
> i can see the value 1 in the 'dst' object. this behavior is observed on WAS JDK1.6 but the same code is working fine on WAS JDK1.5
> suspecting on two variants of setActivated() method. but the pointer here the same code is working fine on JDK1.5
> is this a compliance problem with JDK1.6 with the BeanUtil.copyProperties() method?
> -srinivas

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (BEANUTILS-360) BeanUtils.copyProperties() method is not working in JDK1.6

Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BEANUTILS-360?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12763475#action_12763475 ] 

Niall Pemberton commented on BEANUTILS-360:
-------------------------------------------

OK I've been thinking about this - I beliueve you are breaking the JavaBean Specification[1]  by overloading the setter method for your "activated" property. I guess that the IBM JDK is finding the primitive setter first and because there is no primitive  "getter" method it is treating it as a *Write-only* property and hence the property cannot be copied, since it can't find a "getter". The correct solution IMO is for you to remove the primitive "setter" - or rename it to something else [e.g. setActivatedPrimitive(int)] and I'm sure you're issue will be resolved.


[1] http://java.sun.com/javase/technologies/desktop/javabeans/docs/spec.html

> BeanUtils.copyProperties() method is not working in JDK1.6
> ----------------------------------------------------------
>
>                 Key: BEANUTILS-360
>                 URL: https://issues.apache.org/jira/browse/BEANUTILS-360
>             Project: Commons BeanUtils
>          Issue Type: Wish
>          Components: Bean / Property Utils
>    Affects Versions: 1.7.0
>         Environment: WebSphere Application Server v7.0.0.3 (WAS) , RAD7.5.3
>            Reporter: Srinivas Vemula
>
> we are using beanutils 1.7.0 version and the below code is not working as expected. as i mentioned we are using the WebSphere Application server v7.0.0.3 JDK. i.e, JDK1.6
> code snippet:
> interface GroupInterface :
> ------------------------------
> package test.groups;
> public interface GroupInterface {
> 	 public static final int ACTIVE 	= 1;
> 	  public static final int INACTIVE 	= 0;
> 	  public static final int DELETED 	= -1;
> 	  
> 	  public void setActivated(Integer value) ;
> 	  public Integer getActivated() ;
> }
> GRPinfo.java :
> ----------------------
> package test.groups;
> public class GRPInfo implements GroupInterface {
> 	private Integer activated;
> 		
> 	public void setActivated(int value) {
> 		setActivated(new Integer(value));
> 	}
> 	public void setActivated(Integer value) {
> 		this.activated = value;
> 	}
> 	public Integer getActivated() {
> 		return activated;
> 	}	
> }
> GRPTest.java :
> ---------------------
> package test.groups;
> import org.apache.commons.beanutils.BeanUtils;
> public class GRPTest {
> 	public static void main(String[] args) throws Exception {
> 		
> 		GRPInfo src = new GRPInfo();		
> 		src.setActivated(GroupInterface.DELETED);
> 		
> 		GRPInfo dst = new GRPInfo();
> 		dst.setActivated(GroupInterface.ACTIVE);		
> 		
> 			System.out.println(" SRC Activated -->"+src.getActivated());
> 			BeanUtils.copyProperties(dst,src);
> 			System.out.println("DST Activated "+dst.getActivated());
> 	}
> }
> If i run the above sample application (GRPTest.java), the 'copyProperties()' is not actually copying the values from 'src' to 'dst'.
> i can see the value 1 in the 'dst' object. this behavior is observed on WAS JDK1.6 but the same code is working fine on WAS JDK1.5
> suspecting on two variants of setActivated() method. but the pointer here the same code is working fine on JDK1.5
> is this a compliance problem with JDK1.6 with the BeanUtil.copyProperties() method?
> -srinivas

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (BEANUTILS-360) BeanUtils.copyProperties() method is not working in JDK1.6

Posted by "Srinivas Vemula (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BEANUTILS-360?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12763390#action_12763390 ] 

Srinivas Vemula commented on BEANUTILS-360:
-------------------------------------------

its working fine with the Sun's JDK 1.6.0, but it is not working with the IBM WebSphere applications servers V's JDK1.6 (which we will get when we install this server ).try testing with this JDK

> BeanUtils.copyProperties() method is not working in JDK1.6
> ----------------------------------------------------------
>
>                 Key: BEANUTILS-360
>                 URL: https://issues.apache.org/jira/browse/BEANUTILS-360
>             Project: Commons BeanUtils
>          Issue Type: Wish
>          Components: Bean / Property Utils
>    Affects Versions: 1.7.0
>         Environment: WebSphere Application Server v7.0.0.3 (WAS) , RAD7.5.3
>            Reporter: Srinivas Vemula
>
> we are using beanutils 1.7.0 version and the below code is not working as expected. as i mentioned we are using the WebSphere Application server v7.0.0.3 JDK. i.e, JDK1.6
> code snippet:
> interface GroupInterface :
> ------------------------------
> package test.groups;
> public interface GroupInterface {
> 	 public static final int ACTIVE 	= 1;
> 	  public static final int INACTIVE 	= 0;
> 	  public static final int DELETED 	= -1;
> 	  
> 	  public void setActivated(Integer value) ;
> 	  public Integer getActivated() ;
> }
> GRPinfo.java :
> ----------------------
> package test.groups;
> public class GRPInfo implements GroupInterface {
> 	private Integer activated;
> 		
> 	public void setActivated(int value) {
> 		setActivated(new Integer(value));
> 	}
> 	public void setActivated(Integer value) {
> 		this.activated = value;
> 	}
> 	public Integer getActivated() {
> 		return activated;
> 	}	
> }
> GRPTest.java :
> ---------------------
> package test.groups;
> import org.apache.commons.beanutils.BeanUtils;
> public class GRPTest {
> 	public static void main(String[] args) throws Exception {
> 		
> 		GRPInfo src = new GRPInfo();		
> 		src.setActivated(GroupInterface.DELETED);
> 		
> 		GRPInfo dst = new GRPInfo();
> 		dst.setActivated(GroupInterface.ACTIVE);		
> 		
> 			System.out.println(" SRC Activated -->"+src.getActivated());
> 			BeanUtils.copyProperties(dst,src);
> 			System.out.println("DST Activated "+dst.getActivated());
> 	}
> }
> If i run the above sample application (GRPTest.java), the 'copyProperties()' is not actually copying the values from 'src' to 'dst'.
> i can see the value 1 in the 'dst' object. this behavior is observed on WAS JDK1.6 but the same code is working fine on WAS JDK1.5
> suspecting on two variants of setActivated() method. but the pointer here the same code is working fine on JDK1.5
> is this a compliance problem with JDK1.6 with the BeanUtil.copyProperties() method?
> -srinivas

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (BEANUTILS-360) BeanUtils.copyProperties() method is not working in JDK1.6

Posted by "Srinivas Vemula (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BEANUTILS-360?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12763486#action_12763486 ] 

Srinivas Vemula commented on BEANUTILS-360:
-------------------------------------------

but the same code is working fine with IBM JDK1.5 (part of IBM WebSphere application server V6.1 installation )
before, we are using IBM WAS6.1 we recently migrated to IBM WAS7.0.0.3 and we are facing this problem

> BeanUtils.copyProperties() method is not working in JDK1.6
> ----------------------------------------------------------
>
>                 Key: BEANUTILS-360
>                 URL: https://issues.apache.org/jira/browse/BEANUTILS-360
>             Project: Commons BeanUtils
>          Issue Type: Wish
>          Components: Bean / Property Utils
>    Affects Versions: 1.7.0
>         Environment: WebSphere Application Server v7.0.0.3 (WAS) , RAD7.5.3
>            Reporter: Srinivas Vemula
>
> we are using beanutils 1.7.0 version and the below code is not working as expected. as i mentioned we are using the WebSphere Application server v7.0.0.3 JDK. i.e, JDK1.6
> code snippet:
> interface GroupInterface :
> ------------------------------
> package test.groups;
> public interface GroupInterface {
> 	 public static final int ACTIVE 	= 1;
> 	  public static final int INACTIVE 	= 0;
> 	  public static final int DELETED 	= -1;
> 	  
> 	  public void setActivated(Integer value) ;
> 	  public Integer getActivated() ;
> }
> GRPinfo.java :
> ----------------------
> package test.groups;
> public class GRPInfo implements GroupInterface {
> 	private Integer activated;
> 		
> 	public void setActivated(int value) {
> 		setActivated(new Integer(value));
> 	}
> 	public void setActivated(Integer value) {
> 		this.activated = value;
> 	}
> 	public Integer getActivated() {
> 		return activated;
> 	}	
> }
> GRPTest.java :
> ---------------------
> package test.groups;
> import org.apache.commons.beanutils.BeanUtils;
> public class GRPTest {
> 	public static void main(String[] args) throws Exception {
> 		
> 		GRPInfo src = new GRPInfo();		
> 		src.setActivated(GroupInterface.DELETED);
> 		
> 		GRPInfo dst = new GRPInfo();
> 		dst.setActivated(GroupInterface.ACTIVE);		
> 		
> 			System.out.println(" SRC Activated -->"+src.getActivated());
> 			BeanUtils.copyProperties(dst,src);
> 			System.out.println("DST Activated "+dst.getActivated());
> 	}
> }
> If i run the above sample application (GRPTest.java), the 'copyProperties()' is not actually copying the values from 'src' to 'dst'.
> i can see the value 1 in the 'dst' object. this behavior is observed on WAS JDK1.6 but the same code is working fine on WAS JDK1.5
> suspecting on two variants of setActivated() method. but the pointer here the same code is working fine on JDK1.5
> is this a compliance problem with JDK1.6 with the BeanUtil.copyProperties() method?
> -srinivas

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (BEANUTILS-360) BeanUtils.copyProperties() method is not working in JDK1.6

Posted by "Srinivas Vemula (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BEANUTILS-360?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12763393#action_12763393 ] 

Srinivas Vemula commented on BEANUTILS-360:
-------------------------------------------

if you install IBM WebSphere applications servers V7.0 you will get IBM JDK1.6

> BeanUtils.copyProperties() method is not working in JDK1.6
> ----------------------------------------------------------
>
>                 Key: BEANUTILS-360
>                 URL: https://issues.apache.org/jira/browse/BEANUTILS-360
>             Project: Commons BeanUtils
>          Issue Type: Wish
>          Components: Bean / Property Utils
>    Affects Versions: 1.7.0
>         Environment: WebSphere Application Server v7.0.0.3 (WAS) , RAD7.5.3
>            Reporter: Srinivas Vemula
>
> we are using beanutils 1.7.0 version and the below code is not working as expected. as i mentioned we are using the WebSphere Application server v7.0.0.3 JDK. i.e, JDK1.6
> code snippet:
> interface GroupInterface :
> ------------------------------
> package test.groups;
> public interface GroupInterface {
> 	 public static final int ACTIVE 	= 1;
> 	  public static final int INACTIVE 	= 0;
> 	  public static final int DELETED 	= -1;
> 	  
> 	  public void setActivated(Integer value) ;
> 	  public Integer getActivated() ;
> }
> GRPinfo.java :
> ----------------------
> package test.groups;
> public class GRPInfo implements GroupInterface {
> 	private Integer activated;
> 		
> 	public void setActivated(int value) {
> 		setActivated(new Integer(value));
> 	}
> 	public void setActivated(Integer value) {
> 		this.activated = value;
> 	}
> 	public Integer getActivated() {
> 		return activated;
> 	}	
> }
> GRPTest.java :
> ---------------------
> package test.groups;
> import org.apache.commons.beanutils.BeanUtils;
> public class GRPTest {
> 	public static void main(String[] args) throws Exception {
> 		
> 		GRPInfo src = new GRPInfo();		
> 		src.setActivated(GroupInterface.DELETED);
> 		
> 		GRPInfo dst = new GRPInfo();
> 		dst.setActivated(GroupInterface.ACTIVE);		
> 		
> 			System.out.println(" SRC Activated -->"+src.getActivated());
> 			BeanUtils.copyProperties(dst,src);
> 			System.out.println("DST Activated "+dst.getActivated());
> 	}
> }
> If i run the above sample application (GRPTest.java), the 'copyProperties()' is not actually copying the values from 'src' to 'dst'.
> i can see the value 1 in the 'dst' object. this behavior is observed on WAS JDK1.6 but the same code is working fine on WAS JDK1.5
> suspecting on two variants of setActivated() method. but the pointer here the same code is working fine on JDK1.5
> is this a compliance problem with JDK1.6 with the BeanUtil.copyProperties() method?
> -srinivas

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (BEANUTILS-360) BeanUtils.copyProperties() method is not working in JDK1.6

Posted by "Srinivas Vemula (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BEANUTILS-360?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12763463#action_12763463 ] 

Srinivas Vemula commented on BEANUTILS-360:
-------------------------------------------

no i have not contacted.. but i will do that now

> BeanUtils.copyProperties() method is not working in JDK1.6
> ----------------------------------------------------------
>
>                 Key: BEANUTILS-360
>                 URL: https://issues.apache.org/jira/browse/BEANUTILS-360
>             Project: Commons BeanUtils
>          Issue Type: Wish
>          Components: Bean / Property Utils
>    Affects Versions: 1.7.0
>         Environment: WebSphere Application Server v7.0.0.3 (WAS) , RAD7.5.3
>            Reporter: Srinivas Vemula
>
> we are using beanutils 1.7.0 version and the below code is not working as expected. as i mentioned we are using the WebSphere Application server v7.0.0.3 JDK. i.e, JDK1.6
> code snippet:
> interface GroupInterface :
> ------------------------------
> package test.groups;
> public interface GroupInterface {
> 	 public static final int ACTIVE 	= 1;
> 	  public static final int INACTIVE 	= 0;
> 	  public static final int DELETED 	= -1;
> 	  
> 	  public void setActivated(Integer value) ;
> 	  public Integer getActivated() ;
> }
> GRPinfo.java :
> ----------------------
> package test.groups;
> public class GRPInfo implements GroupInterface {
> 	private Integer activated;
> 		
> 	public void setActivated(int value) {
> 		setActivated(new Integer(value));
> 	}
> 	public void setActivated(Integer value) {
> 		this.activated = value;
> 	}
> 	public Integer getActivated() {
> 		return activated;
> 	}	
> }
> GRPTest.java :
> ---------------------
> package test.groups;
> import org.apache.commons.beanutils.BeanUtils;
> public class GRPTest {
> 	public static void main(String[] args) throws Exception {
> 		
> 		GRPInfo src = new GRPInfo();		
> 		src.setActivated(GroupInterface.DELETED);
> 		
> 		GRPInfo dst = new GRPInfo();
> 		dst.setActivated(GroupInterface.ACTIVE);		
> 		
> 			System.out.println(" SRC Activated -->"+src.getActivated());
> 			BeanUtils.copyProperties(dst,src);
> 			System.out.println("DST Activated "+dst.getActivated());
> 	}
> }
> If i run the above sample application (GRPTest.java), the 'copyProperties()' is not actually copying the values from 'src' to 'dst'.
> i can see the value 1 in the 'dst' object. this behavior is observed on WAS JDK1.6 but the same code is working fine on WAS JDK1.5
> suspecting on two variants of setActivated() method. but the pointer here the same code is working fine on JDK1.5
> is this a compliance problem with JDK1.6 with the BeanUtil.copyProperties() method?
> -srinivas

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (BEANUTILS-360) BeanUtils.copyProperties() method is not working in JDK1.6

Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BEANUTILS-360?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Niall Pemberton updated BEANUTILS-360:
--------------------------------------

    Attachment: Jira360TestCase.java

I'm attaching the test case I wrote here because I'm going to delete it from subversion - since it will fail if anyone runs the tests on IBM JDK 1.6 - and possibly other JDKs

> BeanUtils.copyProperties() method is not working in JDK1.6
> ----------------------------------------------------------
>
>                 Key: BEANUTILS-360
>                 URL: https://issues.apache.org/jira/browse/BEANUTILS-360
>             Project: Commons BeanUtils
>          Issue Type: Wish
>          Components: Bean / Property Utils
>    Affects Versions: 1.7.0
>         Environment: WebSphere Application Server v7.0.0.3 (WAS) , RAD7.5.3
>            Reporter: Srinivas Vemula
>         Attachments: Jira360TestCase.java
>
>
> we are using beanutils 1.7.0 version and the below code is not working as expected. as i mentioned we are using the WebSphere Application server v7.0.0.3 JDK. i.e, JDK1.6
> code snippet:
> interface GroupInterface :
> ------------------------------
> package test.groups;
> public interface GroupInterface {
> 	 public static final int ACTIVE 	= 1;
> 	  public static final int INACTIVE 	= 0;
> 	  public static final int DELETED 	= -1;
> 	  
> 	  public void setActivated(Integer value) ;
> 	  public Integer getActivated() ;
> }
> GRPinfo.java :
> ----------------------
> package test.groups;
> public class GRPInfo implements GroupInterface {
> 	private Integer activated;
> 		
> 	public void setActivated(int value) {
> 		setActivated(new Integer(value));
> 	}
> 	public void setActivated(Integer value) {
> 		this.activated = value;
> 	}
> 	public Integer getActivated() {
> 		return activated;
> 	}	
> }
> GRPTest.java :
> ---------------------
> package test.groups;
> import org.apache.commons.beanutils.BeanUtils;
> public class GRPTest {
> 	public static void main(String[] args) throws Exception {
> 		
> 		GRPInfo src = new GRPInfo();		
> 		src.setActivated(GroupInterface.DELETED);
> 		
> 		GRPInfo dst = new GRPInfo();
> 		dst.setActivated(GroupInterface.ACTIVE);		
> 		
> 			System.out.println(" SRC Activated -->"+src.getActivated());
> 			BeanUtils.copyProperties(dst,src);
> 			System.out.println("DST Activated "+dst.getActivated());
> 	}
> }
> If i run the above sample application (GRPTest.java), the 'copyProperties()' is not actually copying the values from 'src' to 'dst'.
> i can see the value 1 in the 'dst' object. this behavior is observed on WAS JDK1.6 but the same code is working fine on WAS JDK1.5
> suspecting on two variants of setActivated() method. but the pointer here the same code is working fine on JDK1.5
> is this a compliance problem with JDK1.6 with the BeanUtil.copyProperties() method?
> -srinivas

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (BEANUTILS-360) BeanUtils.copyProperties() method is not working in JDK1.6

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BEANUTILS-360?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Yandell closed BEANUTILS-360.
-----------------------------------

    Resolution: Won't Fix

Looks like this is resolved, so closing.

> BeanUtils.copyProperties() method is not working in JDK1.6
> ----------------------------------------------------------
>
>                 Key: BEANUTILS-360
>                 URL: https://issues.apache.org/jira/browse/BEANUTILS-360
>             Project: Commons BeanUtils
>          Issue Type: Wish
>          Components: Bean / Property Utils
>    Affects Versions: 1.7.0
>         Environment: WebSphere Application Server v7.0.0.3 (WAS) , RAD7.5.3
>            Reporter: Srinivas Vemula
>         Attachments: Jira360TestCase.java
>
>
> we are using beanutils 1.7.0 version and the below code is not working as expected. as i mentioned we are using the WebSphere Application server v7.0.0.3 JDK. i.e, JDK1.6
> code snippet:
> interface GroupInterface :
> ------------------------------
> package test.groups;
> public interface GroupInterface {
> 	 public static final int ACTIVE 	= 1;
> 	  public static final int INACTIVE 	= 0;
> 	  public static final int DELETED 	= -1;
> 	  
> 	  public void setActivated(Integer value) ;
> 	  public Integer getActivated() ;
> }
> GRPinfo.java :
> ----------------------
> package test.groups;
> public class GRPInfo implements GroupInterface {
> 	private Integer activated;
> 		
> 	public void setActivated(int value) {
> 		setActivated(new Integer(value));
> 	}
> 	public void setActivated(Integer value) {
> 		this.activated = value;
> 	}
> 	public Integer getActivated() {
> 		return activated;
> 	}	
> }
> GRPTest.java :
> ---------------------
> package test.groups;
> import org.apache.commons.beanutils.BeanUtils;
> public class GRPTest {
> 	public static void main(String[] args) throws Exception {
> 		
> 		GRPInfo src = new GRPInfo();		
> 		src.setActivated(GroupInterface.DELETED);
> 		
> 		GRPInfo dst = new GRPInfo();
> 		dst.setActivated(GroupInterface.ACTIVE);		
> 		
> 			System.out.println(" SRC Activated -->"+src.getActivated());
> 			BeanUtils.copyProperties(dst,src);
> 			System.out.println("DST Activated "+dst.getActivated());
> 	}
> }
> If i run the above sample application (GRPTest.java), the 'copyProperties()' is not actually copying the values from 'src' to 'dst'.
> i can see the value 1 in the 'dst' object. this behavior is observed on WAS JDK1.6 but the same code is working fine on WAS JDK1.5
> suspecting on two variants of setActivated() method. but the pointer here the same code is working fine on JDK1.5
> is this a compliance problem with JDK1.6 with the BeanUtil.copyProperties() method?
> -srinivas

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (BEANUTILS-360) BeanUtils.copyProperties() method is not working in JDK1.6

Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BEANUTILS-360?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12762178#action_12762178 ] 

Niall Pemberton commented on BEANUTILS-360:
-------------------------------------------

I wrote a test case for this, but only just committed it:

http://svn.apache.org/repos/asf/commons/proper/beanutils/trunk/src/test/org/apache/commons/beanutils/bugs/Jira360TestCase.java

> BeanUtils.copyProperties() method is not working in JDK1.6
> ----------------------------------------------------------
>
>                 Key: BEANUTILS-360
>                 URL: https://issues.apache.org/jira/browse/BEANUTILS-360
>             Project: Commons BeanUtils
>          Issue Type: Wish
>          Components: Bean / Property Utils
>    Affects Versions: 1.7.0
>         Environment: WebSphere Application Server v7.0.0.3 (WAS) , RAD7.5.3
>            Reporter: Srinivas Vemula
>
> we are using beanutils 1.7.0 version and the below code is not working as expected. as i mentioned we are using the WebSphere Application server v7.0.0.3 JDK. i.e, JDK1.6
> code snippet:
> interface GroupInterface :
> ------------------------------
> package test.groups;
> public interface GroupInterface {
> 	 public static final int ACTIVE 	= 1;
> 	  public static final int INACTIVE 	= 0;
> 	  public static final int DELETED 	= -1;
> 	  
> 	  public void setActivated(Integer value) ;
> 	  public Integer getActivated() ;
> }
> GRPinfo.java :
> ----------------------
> package test.groups;
> public class GRPInfo implements GroupInterface {
> 	private Integer activated;
> 		
> 	public void setActivated(int value) {
> 		setActivated(new Integer(value));
> 	}
> 	public void setActivated(Integer value) {
> 		this.activated = value;
> 	}
> 	public Integer getActivated() {
> 		return activated;
> 	}	
> }
> GRPTest.java :
> ---------------------
> package test.groups;
> import org.apache.commons.beanutils.BeanUtils;
> public class GRPTest {
> 	public static void main(String[] args) throws Exception {
> 		
> 		GRPInfo src = new GRPInfo();		
> 		src.setActivated(GroupInterface.DELETED);
> 		
> 		GRPInfo dst = new GRPInfo();
> 		dst.setActivated(GroupInterface.ACTIVE);		
> 		
> 			System.out.println(" SRC Activated -->"+src.getActivated());
> 			BeanUtils.copyProperties(dst,src);
> 			System.out.println("DST Activated "+dst.getActivated());
> 	}
> }
> If i run the above sample application (GRPTest.java), the 'copyProperties()' is not actually copying the values from 'src' to 'dst'.
> i can see the value 1 in the 'dst' object. this behavior is observed on WAS JDK1.6 but the same code is working fine on WAS JDK1.5
> suspecting on two variants of setActivated() method. but the pointer here the same code is working fine on JDK1.5
> is this a compliance problem with JDK1.6 with the BeanUtil.copyProperties() method?
> -srinivas

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (BEANUTILS-360) BeanUtils.copyProperties() method is not working in JDK1.6

Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BEANUTILS-360?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12763488#action_12763488 ] 

Niall Pemberton commented on BEANUTILS-360:
-------------------------------------------

The fact that it worked is just luck IMO - it happened to find the Integer getter/setter methods before the primitive setter. For properties you need to define a pair of getter/setter methods and not multiple setters for the same property. Its a bad practice and you should fix your code. You should fix it even if it wasn't breaking in IBM JDK 1.6!

> BeanUtils.copyProperties() method is not working in JDK1.6
> ----------------------------------------------------------
>
>                 Key: BEANUTILS-360
>                 URL: https://issues.apache.org/jira/browse/BEANUTILS-360
>             Project: Commons BeanUtils
>          Issue Type: Wish
>          Components: Bean / Property Utils
>    Affects Versions: 1.7.0
>         Environment: WebSphere Application Server v7.0.0.3 (WAS) , RAD7.5.3
>            Reporter: Srinivas Vemula
>
> we are using beanutils 1.7.0 version and the below code is not working as expected. as i mentioned we are using the WebSphere Application server v7.0.0.3 JDK. i.e, JDK1.6
> code snippet:
> interface GroupInterface :
> ------------------------------
> package test.groups;
> public interface GroupInterface {
> 	 public static final int ACTIVE 	= 1;
> 	  public static final int INACTIVE 	= 0;
> 	  public static final int DELETED 	= -1;
> 	  
> 	  public void setActivated(Integer value) ;
> 	  public Integer getActivated() ;
> }
> GRPinfo.java :
> ----------------------
> package test.groups;
> public class GRPInfo implements GroupInterface {
> 	private Integer activated;
> 		
> 	public void setActivated(int value) {
> 		setActivated(new Integer(value));
> 	}
> 	public void setActivated(Integer value) {
> 		this.activated = value;
> 	}
> 	public Integer getActivated() {
> 		return activated;
> 	}	
> }
> GRPTest.java :
> ---------------------
> package test.groups;
> import org.apache.commons.beanutils.BeanUtils;
> public class GRPTest {
> 	public static void main(String[] args) throws Exception {
> 		
> 		GRPInfo src = new GRPInfo();		
> 		src.setActivated(GroupInterface.DELETED);
> 		
> 		GRPInfo dst = new GRPInfo();
> 		dst.setActivated(GroupInterface.ACTIVE);		
> 		
> 			System.out.println(" SRC Activated -->"+src.getActivated());
> 			BeanUtils.copyProperties(dst,src);
> 			System.out.println("DST Activated "+dst.getActivated());
> 	}
> }
> If i run the above sample application (GRPTest.java), the 'copyProperties()' is not actually copying the values from 'src' to 'dst'.
> i can see the value 1 in the 'dst' object. this behavior is observed on WAS JDK1.6 but the same code is working fine on WAS JDK1.5
> suspecting on two variants of setActivated() method. but the pointer here the same code is working fine on JDK1.5
> is this a compliance problem with JDK1.6 with the BeanUtil.copyProperties() method?
> -srinivas

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (BEANUTILS-360) BeanUtils.copyProperties() method is not working in JDK1.6

Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BEANUTILS-360?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12763453#action_12763453 ] 

Niall Pemberton commented on BEANUTILS-360:
-------------------------------------------

I will try to get round to do this, but its not high on my priority list. Have you tried contacting IBM to see if its a bug in their JDK?

> BeanUtils.copyProperties() method is not working in JDK1.6
> ----------------------------------------------------------
>
>                 Key: BEANUTILS-360
>                 URL: https://issues.apache.org/jira/browse/BEANUTILS-360
>             Project: Commons BeanUtils
>          Issue Type: Wish
>          Components: Bean / Property Utils
>    Affects Versions: 1.7.0
>         Environment: WebSphere Application Server v7.0.0.3 (WAS) , RAD7.5.3
>            Reporter: Srinivas Vemula
>
> we are using beanutils 1.7.0 version and the below code is not working as expected. as i mentioned we are using the WebSphere Application server v7.0.0.3 JDK. i.e, JDK1.6
> code snippet:
> interface GroupInterface :
> ------------------------------
> package test.groups;
> public interface GroupInterface {
> 	 public static final int ACTIVE 	= 1;
> 	  public static final int INACTIVE 	= 0;
> 	  public static final int DELETED 	= -1;
> 	  
> 	  public void setActivated(Integer value) ;
> 	  public Integer getActivated() ;
> }
> GRPinfo.java :
> ----------------------
> package test.groups;
> public class GRPInfo implements GroupInterface {
> 	private Integer activated;
> 		
> 	public void setActivated(int value) {
> 		setActivated(new Integer(value));
> 	}
> 	public void setActivated(Integer value) {
> 		this.activated = value;
> 	}
> 	public Integer getActivated() {
> 		return activated;
> 	}	
> }
> GRPTest.java :
> ---------------------
> package test.groups;
> import org.apache.commons.beanutils.BeanUtils;
> public class GRPTest {
> 	public static void main(String[] args) throws Exception {
> 		
> 		GRPInfo src = new GRPInfo();		
> 		src.setActivated(GroupInterface.DELETED);
> 		
> 		GRPInfo dst = new GRPInfo();
> 		dst.setActivated(GroupInterface.ACTIVE);		
> 		
> 			System.out.println(" SRC Activated -->"+src.getActivated());
> 			BeanUtils.copyProperties(dst,src);
> 			System.out.println("DST Activated "+dst.getActivated());
> 	}
> }
> If i run the above sample application (GRPTest.java), the 'copyProperties()' is not actually copying the values from 'src' to 'dst'.
> i can see the value 1 in the 'dst' object. this behavior is observed on WAS JDK1.6 but the same code is working fine on WAS JDK1.5
> suspecting on two variants of setActivated() method. but the pointer here the same code is working fine on JDK1.5
> is this a compliance problem with JDK1.6 with the BeanUtil.copyProperties() method?
> -srinivas

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.