Bug 984822 - SY ignores toString method when converting objects to string
Summary: SY ignores toString method when converting objects to string
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: JBoss Fuse Service Works 6
Classification: JBoss
Component: SwitchYard
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: ---
Assignee: Keith Babo
QA Contact: Jiri Sedlacek
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-07-16 06:29 UTC by Jiri Pechanec
Modified: 2015-08-02 23:44 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2013-08-22 17:00:27 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Jiri Pechanec 2013-07-16 06:29:15 UTC
Since the tight integration between Camel and SwitchYard was introduced the POJO messages are automatically converted to XML whenever String representation is required, including message trace.

In the past when toString method was present, it was used to conversion to String. I recommend to return back to this practice - when toString() is declared it should be used, otherwise the conversion could be delegated to Camel internals

Comment 1 Keith Babo 2013-07-16 11:16:18 UTC
I'm going to need an example here as I have not seen this behavior.

Comment 2 Jiri Pechanec 2013-07-16 12:19:53 UTC
ok, so upon further investigation - I did not notice previously that the POJO in question is JAXB-annotated. So whenever there is an internal conversion to string (like for MessageTrace) and the JAXB annotations are present then Camel converter will convert the pojo to XML string.

Comment 3 Keith Babo 2013-08-02 14:50:54 UTC
There's not a whole lot we can about this.  Users are free to register an ExchangeInterceptor and call toString() on the payload directly if they want to dump the content.


Note You need to log in before you can comment on or make changes to this bug.