[ 
https://issues.apache.org/activemq/browse/CAMEL-1563?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=51419#action_51419
 ] 

Claus Ibsen commented on CAMEL-1563:
------------------------------------

[11:47]  <jstrachan> the common case is gonna be folks accessing the out to set 
stuff in it, so if anything I'd prefer getOut()  / getFault() to never return 
null - but have a separate method, hasOut(), hasFault()
[11:48]  <cibsen> and to mark it as @deprecated would probably over stepping
[11:48]  <cibsen> yeah adding the hasOut etc will make it more clear to use 
them to test whether there is or not is
[11:48]  <cibsen> so a good solution would to add the hasXXX methods and keep 
it as is
[11:49]  <cibsen> and add a notice in getOut javadoc that prefer to use hasXXX 
to test if exists or not
[11:49]  <jstrachan> yeah - and deprecate getOut(boolean)?
[11:50]  <gertv> why deprecate it for Camel 2.0?
[11:50]  <gertv> we've have broken tons of code already
[11:50]  <jstrachan> yeah good point
[11:51]  <cibsen> I guess getOut(false) is also used by end users in their 
custom processors
[11:51]  <cibsen> if we remove it they should change to hasOut
[11:52]  <cibsen> we could mark it as @deprecated in 2.0m2 and then remove it 
in 2.0 GA
[11:55]  <jstrachan> yeah
[11:55]  <cibsen> +1 that is



> Message - getOut, getFault should not create empty message if none exists
> -------------------------------------------------------------------------
>
>                 Key: CAMEL-1563
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1563
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.0-M1
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>             Fix For: 2.0.0
>
>
> The getOut and getFault methods on org.apache.camel.Message creates a new 
> empty object if none exists already.
> This confuses end users when they use the methods in their custom processors.
> We should instead add hasOut, hasFault methods that can be used for checking 
> if it exists or not.
> *Note:* The getOut(false) can be used to not create a new message if none 
> exists but its really not adhering to good java beans standard.
> See nabble:
> http://www.nabble.com/Payload-Gets-Nulled-Out-td23105477.html

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

Reply via email to