You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "James Carman (JIRA)" <ji...@apache.org> on 2012/09/22 13:42:07 UTC

[jira] [Created] (CAMEL-5641) JmsBinding Does Not Handle BigInteger and BigDecimal Properly

James Carman created CAMEL-5641:
-----------------------------------

             Summary: JmsBinding Does Not Handle BigInteger and BigDecimal Properly
                 Key: CAMEL-5641
                 URL: https://issues.apache.org/jira/browse/CAMEL-5641
             Project: Camel
          Issue Type: Bug
          Components: camel-jms
         Environment: java version "1.6.0_35"
Java(TM) SE Runtime Environment (build 1.6.0_35-b10-428-11M3811)
Java HotSpot(TM) 64-Bit Server VM (build 20.10-b01-428, mixed mode)
            Reporter: James Carman


According to the documentation:

"The values must be primitives or their counter objects (such as
Integer, Long, Character). The types, String, CharSequence, Date,
BigDecimal and BigInteger are all converted to their toString()
representation. All other types are dropped."

So, it would seem that BigInteger should be toString()ed.  However, in
the JmsBinding class, we see the following code:

{code}
protected Object getValidJMSHeaderValue(String headerName, Object headerValue) {
        if (headerValue instanceof String) {
            return headerValue;
        } else if (headerValue instanceof Number) {
            return headerValue;
        } else if (headerValue instanceof Character) {
            return headerValue;
        } else if (headerValue instanceof CharSequence) {
            return headerValue.toString();
        } else if (headerValue instanceof Boolean) {
            return headerValue;
        } else if (headerValue instanceof Date) {
            return headerValue.toString();
        }
        return null;
    }
{code}

Since BigInteger extends Number, it will merely return the instance
itself.

--
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] [Closed] (CAMEL-5641) JmsBinding Does Not Handle BigInteger and BigDecimal Properly

Posted by "Christian Müller (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5641?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christian Müller closed CAMEL-5641.
-----------------------------------

    Resolution: Fixed

Thanks for reporting and providing the patch James. I only did two small modifications to pass our Checkstyle checks. You can read more about it here [1].
It's now fixed. Do you consider to test the SNAPSHOT's whether your fix works for you? ;-)

[1] http://camel.apache.org/building.html
                
> JmsBinding Does Not Handle BigInteger and BigDecimal Properly
> -------------------------------------------------------------
>
>                 Key: CAMEL-5641
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5641
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-jms
>    Affects Versions: 2.9.3, 2.10.1
>         Environment: java version "1.6.0_35"
> Java(TM) SE Runtime Environment (build 1.6.0_35-b10-428-11M3811)
> Java HotSpot(TM) 64-Bit Server VM (build 20.10-b01-428, mixed mode)
>            Reporter: James Carman
>            Assignee: Christian Müller
>            Priority: Minor
>              Labels: patch
>             Fix For: 2.9.4, 2.11.0, 2.10.2
>
>         Attachments: CAMEL-5641.patch
>
>
> According to the documentation:
> "The values must be primitives or their counter objects (such as
> Integer, Long, Character). The types, String, CharSequence, Date,
> BigDecimal and BigInteger are all converted to their toString()
> representation. All other types are dropped."
> So, it would seem that BigInteger should be toString()ed.  However, in
> the JmsBinding class, we see the following code:
> {code}
> protected Object getValidJMSHeaderValue(String headerName, Object headerValue) {
>         if (headerValue instanceof String) {
>             return headerValue;
>         } else if (headerValue instanceof Number) {
>             return headerValue;
>         } else if (headerValue instanceof Character) {
>             return headerValue;
>         } else if (headerValue instanceof CharSequence) {
>             return headerValue.toString();
>         } else if (headerValue instanceof Boolean) {
>             return headerValue;
>         } else if (headerValue instanceof Date) {
>             return headerValue.toString();
>         }
>         return null;
>     }
> {code}
> Since BigInteger extends Number, it will merely return the instance
> itself.

--
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] [Updated] (CAMEL-5641) JmsBinding Does Not Handle BigInteger and BigDecimal Properly

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

James Carman updated CAMEL-5641:
--------------------------------

    Attachment: CAMEL-5641.patch

Fix with test case.
                
> JmsBinding Does Not Handle BigInteger and BigDecimal Properly
> -------------------------------------------------------------
>
>                 Key: CAMEL-5641
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5641
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-jms
>         Environment: java version "1.6.0_35"
> Java(TM) SE Runtime Environment (build 1.6.0_35-b10-428-11M3811)
> Java HotSpot(TM) 64-Bit Server VM (build 20.10-b01-428, mixed mode)
>            Reporter: James Carman
>              Labels: patch
>         Attachments: CAMEL-5641.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> According to the documentation:
> "The values must be primitives or their counter objects (such as
> Integer, Long, Character). The types, String, CharSequence, Date,
> BigDecimal and BigInteger are all converted to their toString()
> representation. All other types are dropped."
> So, it would seem that BigInteger should be toString()ed.  However, in
> the JmsBinding class, we see the following code:
> {code}
> protected Object getValidJMSHeaderValue(String headerName, Object headerValue) {
>         if (headerValue instanceof String) {
>             return headerValue;
>         } else if (headerValue instanceof Number) {
>             return headerValue;
>         } else if (headerValue instanceof Character) {
>             return headerValue;
>         } else if (headerValue instanceof CharSequence) {
>             return headerValue.toString();
>         } else if (headerValue instanceof Boolean) {
>             return headerValue;
>         } else if (headerValue instanceof Date) {
>             return headerValue.toString();
>         }
>         return null;
>     }
> {code}
> Since BigInteger extends Number, it will merely return the instance
> itself.

--
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] [Work started] (CAMEL-5641) JmsBinding Does Not Handle BigInteger and BigDecimal Properly

Posted by "Christian Müller (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5641?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Work on CAMEL-5641 started by Christian Müller.

> JmsBinding Does Not Handle BigInteger and BigDecimal Properly
> -------------------------------------------------------------
>
>                 Key: CAMEL-5641
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5641
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-jms
>         Environment: java version "1.6.0_35"
> Java(TM) SE Runtime Environment (build 1.6.0_35-b10-428-11M3811)
> Java HotSpot(TM) 64-Bit Server VM (build 20.10-b01-428, mixed mode)
>            Reporter: James Carman
>            Assignee: Christian Müller
>              Labels: patch
>         Attachments: CAMEL-5641.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> According to the documentation:
> "The values must be primitives or their counter objects (such as
> Integer, Long, Character). The types, String, CharSequence, Date,
> BigDecimal and BigInteger are all converted to their toString()
> representation. All other types are dropped."
> So, it would seem that BigInteger should be toString()ed.  However, in
> the JmsBinding class, we see the following code:
> {code}
> protected Object getValidJMSHeaderValue(String headerName, Object headerValue) {
>         if (headerValue instanceof String) {
>             return headerValue;
>         } else if (headerValue instanceof Number) {
>             return headerValue;
>         } else if (headerValue instanceof Character) {
>             return headerValue;
>         } else if (headerValue instanceof CharSequence) {
>             return headerValue.toString();
>         } else if (headerValue instanceof Boolean) {
>             return headerValue;
>         } else if (headerValue instanceof Date) {
>             return headerValue.toString();
>         }
>         return null;
>     }
> {code}
> Since BigInteger extends Number, it will merely return the instance
> itself.

--
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] [Assigned] (CAMEL-5641) JmsBinding Does Not Handle BigInteger and BigDecimal Properly

Posted by "Christian Müller (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5641?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christian Müller reassigned CAMEL-5641:
---------------------------------------

    Assignee: Christian Müller
    
> JmsBinding Does Not Handle BigInteger and BigDecimal Properly
> -------------------------------------------------------------
>
>                 Key: CAMEL-5641
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5641
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-jms
>         Environment: java version "1.6.0_35"
> Java(TM) SE Runtime Environment (build 1.6.0_35-b10-428-11M3811)
> Java HotSpot(TM) 64-Bit Server VM (build 20.10-b01-428, mixed mode)
>            Reporter: James Carman
>            Assignee: Christian Müller
>              Labels: patch
>         Attachments: CAMEL-5641.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> According to the documentation:
> "The values must be primitives or their counter objects (such as
> Integer, Long, Character). The types, String, CharSequence, Date,
> BigDecimal and BigInteger are all converted to their toString()
> representation. All other types are dropped."
> So, it would seem that BigInteger should be toString()ed.  However, in
> the JmsBinding class, we see the following code:
> {code}
> protected Object getValidJMSHeaderValue(String headerName, Object headerValue) {
>         if (headerValue instanceof String) {
>             return headerValue;
>         } else if (headerValue instanceof Number) {
>             return headerValue;
>         } else if (headerValue instanceof Character) {
>             return headerValue;
>         } else if (headerValue instanceof CharSequence) {
>             return headerValue.toString();
>         } else if (headerValue instanceof Boolean) {
>             return headerValue;
>         } else if (headerValue instanceof Date) {
>             return headerValue.toString();
>         }
>         return null;
>     }
> {code}
> Since BigInteger extends Number, it will merely return the instance
> itself.

--
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] [Updated] (CAMEL-5641) JmsBinding Does Not Handle BigInteger and BigDecimal Properly

Posted by "Christian Müller (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5641?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christian Müller updated CAMEL-5641:
------------------------------------

              Priority: Minor  (was: Major)
     Affects Version/s: 2.9.3
                        2.10.1
         Fix Version/s: 2.10.2
                        2.11.0
                        2.9.4
    Remaining Estimate:     (was: 1h)
     Original Estimate:     (was: 1h)
    
> JmsBinding Does Not Handle BigInteger and BigDecimal Properly
> -------------------------------------------------------------
>
>                 Key: CAMEL-5641
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5641
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-jms
>    Affects Versions: 2.9.3, 2.10.1
>         Environment: java version "1.6.0_35"
> Java(TM) SE Runtime Environment (build 1.6.0_35-b10-428-11M3811)
> Java HotSpot(TM) 64-Bit Server VM (build 20.10-b01-428, mixed mode)
>            Reporter: James Carman
>            Assignee: Christian Müller
>            Priority: Minor
>              Labels: patch
>             Fix For: 2.9.4, 2.11.0, 2.10.2
>
>         Attachments: CAMEL-5641.patch
>
>
> According to the documentation:
> "The values must be primitives or their counter objects (such as
> Integer, Long, Character). The types, String, CharSequence, Date,
> BigDecimal and BigInteger are all converted to their toString()
> representation. All other types are dropped."
> So, it would seem that BigInteger should be toString()ed.  However, in
> the JmsBinding class, we see the following code:
> {code}
> protected Object getValidJMSHeaderValue(String headerName, Object headerValue) {
>         if (headerValue instanceof String) {
>             return headerValue;
>         } else if (headerValue instanceof Number) {
>             return headerValue;
>         } else if (headerValue instanceof Character) {
>             return headerValue;
>         } else if (headerValue instanceof CharSequence) {
>             return headerValue.toString();
>         } else if (headerValue instanceof Boolean) {
>             return headerValue;
>         } else if (headerValue instanceof Date) {
>             return headerValue.toString();
>         }
>         return null;
>     }
> {code}
> Since BigInteger extends Number, it will merely return the instance
> itself.

--
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] (CAMEL-5641) JmsBinding Does Not Handle BigInteger and BigDecimal Properly

Posted by "James Carman (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13461229#comment-13461229 ] 

James Carman commented on CAMEL-5641:
-------------------------------------

I'm going to run the build in my local Jenkins server.  I'll grab the snapshot once it's done.  Thanks!
                
> JmsBinding Does Not Handle BigInteger and BigDecimal Properly
> -------------------------------------------------------------
>
>                 Key: CAMEL-5641
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5641
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-jms
>    Affects Versions: 2.9.3, 2.10.1
>         Environment: java version "1.6.0_35"
> Java(TM) SE Runtime Environment (build 1.6.0_35-b10-428-11M3811)
> Java HotSpot(TM) 64-Bit Server VM (build 20.10-b01-428, mixed mode)
>            Reporter: James Carman
>            Assignee: Christian Müller
>            Priority: Minor
>              Labels: patch
>             Fix For: 2.9.4, 2.11.0, 2.10.2
>
>         Attachments: CAMEL-5641.patch
>
>
> According to the documentation:
> "The values must be primitives or their counter objects (such as
> Integer, Long, Character). The types, String, CharSequence, Date,
> BigDecimal and BigInteger are all converted to their toString()
> representation. All other types are dropped."
> So, it would seem that BigInteger should be toString()ed.  However, in
> the JmsBinding class, we see the following code:
> {code}
> protected Object getValidJMSHeaderValue(String headerName, Object headerValue) {
>         if (headerValue instanceof String) {
>             return headerValue;
>         } else if (headerValue instanceof Number) {
>             return headerValue;
>         } else if (headerValue instanceof Character) {
>             return headerValue;
>         } else if (headerValue instanceof CharSequence) {
>             return headerValue.toString();
>         } else if (headerValue instanceof Boolean) {
>             return headerValue;
>         } else if (headerValue instanceof Date) {
>             return headerValue.toString();
>         }
>         return null;
>     }
> {code}
> Since BigInteger extends Number, it will merely return the instance
> itself.

--
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