[jira] [Commented] (SYNCOPE-246) Remove collection setters in transfer objects for JAXB marshalling

2013-09-18 Thread Hudson (JIRA)

[ 
https://issues.apache.org/jira/browse/SYNCOPE-246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13770627#comment-13770627
 ] 

Hudson commented on SYNCOPE-246:


SUCCESS: Integrated in Syncope-trunk #445 (See 
[https://builds.apache.org/job/Syncope-trunk/445/])
[SYNCOPE-246] Residual invocation that cannot be checked at compile time due to 
non-generic nature of the collection (ListObject) (ilgrosso: rev 1524341)
* 
/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ConnectorModalPage.java


 Remove collection setters in transfer objects for JAXB marshalling
 --

 Key: SYNCOPE-246
 URL: https://issues.apache.org/jira/browse/SYNCOPE-246
 Project: Syncope
  Issue Type: Sub-task
  Components: core
Affects Versions: 1.1.0
 Environment: CXF branch
Reporter: Andrei Shakirin
Assignee: Francesco Chicchiriccò
 Fix For: 1.2.0


 XML payload will be marshaled/unmarshaled using JAXB by migration to CXF Rest 
 frontend.
 JAXB works with collections in a little bit different way as Spring Rest 
 marshaling.
 JAXB uses only getter for the list (assumes that list is initialized due 
 object creation) and adds elements into the list obtained by getter by 
 unmarshaling. It doesn't need setter at all.
 The problem is that actual implementation of transfer objects doesn't work 
 with JAXB. 
 If TO provide setter for collection, JAXB gets the list, adds the elements 
 and additionally calls setter for this list. As far as setter logic cleans 
 the TO collection, the result collection is always empty.
 Solution is remove setters for collections in TOs by migration on CXF Rest.
 I find it also better from security and encapsulation aspects.
 Regards,
 Andrei.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (SYNCOPE-246) Remove collection setters in transfer objects for JAXB marshalling

2013-07-24 Thread JIRA

[ 
https://issues.apache.org/jira/browse/SYNCOPE-246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13718173#comment-13718173
 ] 

Francesco Chicchiriccò commented on SYNCOPE-246:


[~ch...@die-schneider.net], is this issue still needed? After resolving 
SYNCOPE-286 I have all tests (and console) working fine either with 
application/xml and application/json content types. 

 Remove collection setters in transfer objects for JAXB marshalling
 --

 Key: SYNCOPE-246
 URL: https://issues.apache.org/jira/browse/SYNCOPE-246
 Project: Syncope
  Issue Type: Sub-task
  Components: core
Affects Versions: 1.1.0
 Environment: CXF branch
Reporter: Andrei Shakirin
Assignee: Christian Schneider
 Fix For: 1.2.0


 XML payload will be marshaled/unmarshaled using JAXB by migration to CXF Rest 
 frontend.
 JAXB works with collections in a little bit different way as Spring Rest 
 marshaling.
 JAXB uses only getter for the list (assumes that list is initialized due 
 object creation) and adds elements into the list obtained by getter by 
 unmarshaling. It doesn't need setter at all.
 The problem is that actual implementation of transfer objects doesn't work 
 with JAXB. 
 If TO provide setter for collection, JAXB gets the list, adds the elements 
 and additionally calls setter for this list. As far as setter logic cleans 
 the TO collection, the result collection is always empty.
 Solution is remove setters for collections in TOs by migration on CXF Rest.
 I find it also better from security and encapsulation aspects.
 Regards,
 Andrei.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (SYNCOPE-246) Remove collection setters in transfer objects for JAXB marshalling

2013-07-24 Thread Andrei Shakirin (JIRA)

[ 
https://issues.apache.org/jira/browse/SYNCOPE-246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13718310#comment-13718310
 ] 

Andrei Shakirin commented on SYNCOPE-246:
-

Hi Francesco,

I try to explain the issue: originally we have a problem because JAXB and 
Spring MVC work differently with list members of java beans:
- Spring MVC uses normal setter to set a list value
- JAXB uses only getter to return the list and custom code adds / removes 
elements.

The problem was that if we leave setter for lists in bean, JAXB tries to set 
the same list object through the setter and code in setter clears list content, 
so list will be empty:
public void setEntitlements(final ListString entitlements) {
this.entitlements.clear();
if (entitlements != null  !entitlements.isEmpty()) {
this.entitlements.addAll(entitlements);
}
}

Therefore Christian adds workaround that checks if list object is the same 
(JAXB case) and do nothing in that case:
public void setEntitlements(final ListString entitlements) {
if (this.entitlements != entitlements) {
this.entitlements.clear();
if (entitlements != null  !entitlements.isEmpty()) {
this.entitlements.addAll(entitlements);
}
}
}

But actually, clean final solution will be to remove list setters from TO 
objects at all. That is possible only when we do not support Spring MVC REST 
anymore.

Regards,
Andrei.
 

 Remove collection setters in transfer objects for JAXB marshalling
 --

 Key: SYNCOPE-246
 URL: https://issues.apache.org/jira/browse/SYNCOPE-246
 Project: Syncope
  Issue Type: Sub-task
  Components: core
Affects Versions: 1.1.0
 Environment: CXF branch
Reporter: Andrei Shakirin
Assignee: Christian Schneider
 Fix For: 1.2.0


 XML payload will be marshaled/unmarshaled using JAXB by migration to CXF Rest 
 frontend.
 JAXB works with collections in a little bit different way as Spring Rest 
 marshaling.
 JAXB uses only getter for the list (assumes that list is initialized due 
 object creation) and adds elements into the list obtained by getter by 
 unmarshaling. It doesn't need setter at all.
 The problem is that actual implementation of transfer objects doesn't work 
 with JAXB. 
 If TO provide setter for collection, JAXB gets the list, adds the elements 
 and additionally calls setter for this list. As far as setter logic cleans 
 the TO collection, the result collection is always empty.
 Solution is remove setters for collections in TOs by migration on CXF Rest.
 I find it also better from security and encapsulation aspects.
 Regards,
 Andrei.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (SYNCOPE-246) Remove collection setters in transfer objects for JAXB marshalling

2013-01-23 Thread Christian Schneider (JIRA)

[ 
https://issues.apache.org/jira/browse/SYNCOPE-246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13560569#comment-13560569
 ] 

Christian Schneider commented on SYNCOPE-246:
-

The problem is that the setter is called with exactly the same object as the 
internal list.

So currently it looks like this:
public void setOrders(ListOrder orders) {
this.orders.clear();
this.orders.addAll(orders);
}
If this is called with the internal list object then the result is an empty 
list.

I found that we simply need to check if the incoming object is that same as the 
internal list and then skip the changes.

public void setOrders(ListOrder orders) {
if (this.orders != orders) {
this.orders.clear();
this.orders.addAll(orders);
}
}

So for version 1.1.0 I will change the setters like above. (Will create and 
link a new issue for this).

As soon as we completed the switch to cxf and remove the spring services we 
still should remove the setters. So I will move this issue to 1.2.0



 Remove collection setters in transfer objects for JAXB marshalling
 --

 Key: SYNCOPE-246
 URL: https://issues.apache.org/jira/browse/SYNCOPE-246
 Project: Syncope
  Issue Type: Sub-task
  Components: core
Affects Versions: 1.1.0
 Environment: CXF branch
Reporter: Andrei Shakirin
Assignee: Christian Schneider
 Fix For: 1.1.0


 XML payload will be marshaled/unmarshaled using JAXB by migration to CXF Rest 
 frontend.
 JAXB works with collections in a little bit different way as Spring Rest 
 marshaling.
 JAXB uses only getter for the list (assumes that list is initialized due 
 object creation) and adds elements into the list obtained by getter by 
 unmarshaling. It doesn't need setter at all.
 The problem is that actual implementation of transfer objects doesn't work 
 with JAXB. 
 If TO provide setter for collection, JAXB gets the list, adds the elements 
 and additionally calls setter for this list. As far as setter logic cleans 
 the TO collection, the result collection is always empty.
 Solution is remove setters for collections in TOs by migration on CXF Rest.
 I find it also better from security and encapsulation aspects.
 Regards,
 Andrei.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (SYNCOPE-246) Remove collection setters in transfer objects for JAXB marshalling

2013-01-23 Thread JIRA

[ 
https://issues.apache.org/jira/browse/SYNCOPE-246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13560572#comment-13560572
 ] 

Francesco Chicchiriccò commented on SYNCOPE-246:


Please keep this issue in 1.1.0 and open a new one for 1.2.0, possibly as 
subtask of SYNCOPE-285.

 Remove collection setters in transfer objects for JAXB marshalling
 --

 Key: SYNCOPE-246
 URL: https://issues.apache.org/jira/browse/SYNCOPE-246
 Project: Syncope
  Issue Type: Sub-task
  Components: core
Affects Versions: 1.1.0
 Environment: CXF branch
Reporter: Andrei Shakirin
Assignee: Christian Schneider
 Fix For: 1.1.0


 XML payload will be marshaled/unmarshaled using JAXB by migration to CXF Rest 
 frontend.
 JAXB works with collections in a little bit different way as Spring Rest 
 marshaling.
 JAXB uses only getter for the list (assumes that list is initialized due 
 object creation) and adds elements into the list obtained by getter by 
 unmarshaling. It doesn't need setter at all.
 The problem is that actual implementation of transfer objects doesn't work 
 with JAXB. 
 If TO provide setter for collection, JAXB gets the list, adds the elements 
 and additionally calls setter for this list. As far as setter logic cleans 
 the TO collection, the result collection is always empty.
 Solution is remove setters for collections in TOs by migration on CXF Rest.
 I find it also better from security and encapsulation aspects.
 Regards,
 Andrei.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (SYNCOPE-246) Remove collection setters in transfer objects for JAXB marshalling

2013-01-23 Thread Christian Schneider (JIRA)

[ 
https://issues.apache.org/jira/browse/SYNCOPE-246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13560574#comment-13560574
 ] 

Christian Schneider commented on SYNCOPE-246:
-

I just created a new issue for 1.1.0 and linked it. 

 Remove collection setters in transfer objects for JAXB marshalling
 --

 Key: SYNCOPE-246
 URL: https://issues.apache.org/jira/browse/SYNCOPE-246
 Project: Syncope
  Issue Type: Sub-task
  Components: core
Affects Versions: 1.1.0
 Environment: CXF branch
Reporter: Andrei Shakirin
Assignee: Christian Schneider
 Fix For: 1.1.0


 XML payload will be marshaled/unmarshaled using JAXB by migration to CXF Rest 
 frontend.
 JAXB works with collections in a little bit different way as Spring Rest 
 marshaling.
 JAXB uses only getter for the list (assumes that list is initialized due 
 object creation) and adds elements into the list obtained by getter by 
 unmarshaling. It doesn't need setter at all.
 The problem is that actual implementation of transfer objects doesn't work 
 with JAXB. 
 If TO provide setter for collection, JAXB gets the list, adds the elements 
 and additionally calls setter for this list. As far as setter logic cleans 
 the TO collection, the result collection is always empty.
 Solution is remove setters for collections in TOs by migration on CXF Rest.
 I find it also better from security and encapsulation aspects.
 Regards,
 Andrei.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (SYNCOPE-246) Remove collection setters in transfer objects for JAXB marshalling

2013-01-23 Thread JIRA

[ 
https://issues.apache.org/jira/browse/SYNCOPE-246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13560582#comment-13560582
 ] 

Francesco Chicchiriccò commented on SYNCOPE-246:


I've moved this issue under SYNCOPE-285 and new one (SYNCOPE-288) under 
SYNCOPE-231.

 Remove collection setters in transfer objects for JAXB marshalling
 --

 Key: SYNCOPE-246
 URL: https://issues.apache.org/jira/browse/SYNCOPE-246
 Project: Syncope
  Issue Type: Sub-task
  Components: core
Affects Versions: 1.1.0
 Environment: CXF branch
Reporter: Andrei Shakirin
Assignee: Christian Schneider
 Fix For: 1.2.0


 XML payload will be marshaled/unmarshaled using JAXB by migration to CXF Rest 
 frontend.
 JAXB works with collections in a little bit different way as Spring Rest 
 marshaling.
 JAXB uses only getter for the list (assumes that list is initialized due 
 object creation) and adds elements into the list obtained by getter by 
 unmarshaling. It doesn't need setter at all.
 The problem is that actual implementation of transfer objects doesn't work 
 with JAXB. 
 If TO provide setter for collection, JAXB gets the list, adds the elements 
 and additionally calls setter for this list. As far as setter logic cleans 
 the TO collection, the result collection is always empty.
 Solution is remove setters for collections in TOs by migration on CXF Rest.
 I find it also better from security and encapsulation aspects.
 Regards,
 Andrei.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (SYNCOPE-246) Remove collection setters in transfer objects for JAXB marshalling

2013-01-22 Thread Jan Bernhardt (JIRA)

[ 
https://issues.apache.org/jira/browse/SYNCOPE-246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13559499#comment-13559499
 ] 

Jan Bernhardt commented on SYNCOPE-246:
---

Christian Schneider is currently investigating if it would be possible to keep 
setter for 1.1.0 release but without clearing collections.

 Remove collection setters in transfer objects for JAXB marshalling
 --

 Key: SYNCOPE-246
 URL: https://issues.apache.org/jira/browse/SYNCOPE-246
 Project: Syncope
  Issue Type: Sub-task
  Components: core
Affects Versions: 1.1.0
 Environment: CXF branch
Reporter: Andrei Shakirin
Assignee: Jan Bernhardt
 Fix For: 1.2.0


 XML payload will be marshaled/unmarshaled using JAXB by migration to CXF Rest 
 frontend.
 JAXB works with collections in a little bit different way as Spring Rest 
 marshaling.
 JAXB uses only getter for the list (assumes that list is initialized due 
 object creation) and adds elements into the list obtained by getter by 
 unmarshaling. It doesn't need setter at all.
 The problem is that actual implementation of transfer objects doesn't work 
 with JAXB. 
 If TO provide setter for collection, JAXB gets the list, adds the elements 
 and additionally calls setter for this list. As far as setter logic cleans 
 the TO collection, the result collection is always empty.
 Solution is remove setters for collections in TOs by migration on CXF Rest.
 I find it also better from security and encapsulation aspects.
 Regards,
 Andrei.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (SYNCOPE-246) Remove collection setters in transfer objects for JAXB marshalling

2013-01-22 Thread Christian Schneider (JIRA)

[ 
https://issues.apache.org/jira/browse/SYNCOPE-246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13559504#comment-13559504
 ] 

Christian Schneider commented on SYNCOPE-246:
-

I will check if it is possible to use spring services and cxf services with the 
same transfer objects.

 Remove collection setters in transfer objects for JAXB marshalling
 --

 Key: SYNCOPE-246
 URL: https://issues.apache.org/jira/browse/SYNCOPE-246
 Project: Syncope
  Issue Type: Sub-task
  Components: core
Affects Versions: 1.1.0
 Environment: CXF branch
Reporter: Andrei Shakirin
Assignee: Christian Schneider
 Fix For: 1.1.0


 XML payload will be marshaled/unmarshaled using JAXB by migration to CXF Rest 
 frontend.
 JAXB works with collections in a little bit different way as Spring Rest 
 marshaling.
 JAXB uses only getter for the list (assumes that list is initialized due 
 object creation) and adds elements into the list obtained by getter by 
 unmarshaling. It doesn't need setter at all.
 The problem is that actual implementation of transfer objects doesn't work 
 with JAXB. 
 If TO provide setter for collection, JAXB gets the list, adds the elements 
 and additionally calls setter for this list. As far as setter logic cleans 
 the TO collection, the result collection is always empty.
 Solution is remove setters for collections in TOs by migration on CXF Rest.
 I find it also better from security and encapsulation aspects.
 Regards,
 Andrei.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira