You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2022/01/15 21:24:06 UTC

[GitHub] [camel] bvahdat opened a new pull request #6757: cleanup the camel-jms codebase a bit

bvahdat opened a new pull request #6757:
URL: https://github.com/apache/camel/pull/6757


   <!-- Uncomment and fill this section if your PR is not trivial
   - [ ] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for the change (usually before you start working on it).  Trivial changes like typos do not require a JIRA issue.  Your pull request should address just this issue, without pulling in other changes.
   - [ ] Each commit in the pull request should have a meaningful subject line and body.
   - [ ] If you're unsure, you can format the pull request title like `[CAMEL-XXX] Fixes bug in camel-file component`, where you replace `CAMEL-XXX` with the appropriate JIRA issue.
   - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
   - [ ] Run `mvn clean install -Psourcecheck` in your module with source check enabled to make sure basic checks pass and there are no checkstyle violations. A more thorough check will be performed on your pull request automatically.
   Below are the contribution guidelines:
   https://github.com/apache/camel/blob/main/CONTRIBUTING.md
   -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] davsclaus commented on a change in pull request #6757: cleanup the camel-jms codebase a bit

Posted by GitBox <gi...@apache.org>.
davsclaus commented on a change in pull request #6757:
URL: https://github.com/apache/camel/pull/6757#discussion_r785408591



##########
File path: components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsMessageBodySetNullTest.java
##########
@@ -83,7 +83,7 @@ public void testSetNullBodyUsingSetBody() throws Exception {
             public void configure() throws Exception {
                 from("jms:queue:foo")
                         .to("mock:foo")
-                        .setBody(constant(null))
+                        .setBody(constant(new Object[] { null }))

Review comment:
       Ah okay then simple seems as the best




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] davsclaus merged pull request #6757: cleanup the camel-jms codebase a bit

Posted by GitBox <gi...@apache.org>.
davsclaus merged pull request #6757:
URL: https://github.com/apache/camel/pull/6757


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] bvahdat commented on a change in pull request #6757: cleanup the camel-jms codebase a bit

Posted by GitBox <gi...@apache.org>.
bvahdat commented on a change in pull request #6757:
URL: https://github.com/apache/camel/pull/6757#discussion_r785407508



##########
File path: components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsMessageBodySetNullTest.java
##########
@@ -83,7 +83,7 @@ public void testSetNullBodyUsingSetBody() throws Exception {
             public void configure() throws Exception {
                 from("jms:queue:foo")
                         .to("mock:foo")
-                        .setBody(constant(null))
+                        .setBody(constant(new Object[] { null }))

Review comment:
       Without that change the compiler would complain as:
   
   ```
   [WARNING] /Users/bvahdat/dev/workspace/camel/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsMessageBodySetNullTest.java:[86,42] non-varargs call of varargs method with inexact argument type for last parameter;
   ```
   
   The problem is that `BuilderSupport#constant` is overloaded (which doesn't really fits for the `null` case):
   
   ```
   public ValueBuilder constant(Object value)
   
   public ValueBuilder constant(Object... value)
   ```
   
   And the compiler thinks we intend to invoke the second one and gives that warning above. To overcome that I did that change to make it clear and resolve that warning.
   
   Instead we could also do:
   
   ```
   .setBody(simple("${null}"))
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] bvahdat commented on a change in pull request #6757: cleanup the camel-jms codebase a bit

Posted by GitBox <gi...@apache.org>.
bvahdat commented on a change in pull request #6757:
URL: https://github.com/apache/camel/pull/6757#discussion_r785407765



##########
File path: components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsMessageBodySetNullTest.java
##########
@@ -83,7 +83,7 @@ public void testSetNullBodyUsingSetBody() throws Exception {
             public void configure() throws Exception {
                 from("jms:queue:foo")
                         .to("mock:foo")
-                        .setBody(constant(null))
+                        .setBody(constant(new Object[] { null }))

Review comment:
       ```
   .setBody(constant((Object) null))
   ```
   
   Would be the other option.
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] davsclaus commented on a change in pull request #6757: cleanup the camel-jms codebase a bit

Posted by GitBox <gi...@apache.org>.
davsclaus commented on a change in pull request #6757:
URL: https://github.com/apache/camel/pull/6757#discussion_r785398142



##########
File path: components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsMessageBodySetNullTest.java
##########
@@ -83,7 +83,7 @@ public void testSetNullBodyUsingSetBody() throws Exception {
             public void configure() throws Exception {
                 from("jms:queue:foo")
                         .to("mock:foo")
-                        .setBody(constant(null))
+                        .setBody(constant(new Object[] { null }))

Review comment:
       This looks weird/wrong. Setting null as before can be how end users would set a null body.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org