You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by or...@apache.org on 2022/10/04 12:25:57 UTC

[camel] branch main updated (ef9e711e5ab -> 7e221d527fb)

This is an automated email from the ASF dual-hosted git repository.

orpiske pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


    from ef9e711e5ab (chores) Inlined calls to CamelTestSupport.resetMocks
     new 4f2de37369c (chores) camel-report-maven-plugin: apply required cast for intermediate variables
     new 9dbfcb217ff (chores) camel-aws2-sqs: simplify overly complex cast
     new 8625905fa05 (chores) camel-aws2-s3: apply required cast
     new e5079ded491 (chores) camel-azure-storage-datalake: avoid test false positives due to empty lists
     new 734b5c5a7ce (chores) camel-bindy: avoid subtle bugs caused by rounding errors
     new 308d8f01e72 (chores) camel-jsonpath: apply required cast for intermediate variables
     new 7e221d527fb (chores) camel-micrometer: simplify overly complex cast

The 7 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../src/main/java/org/apache/camel/maven/ValidateMojo.java            | 2 +-
 .../java/org/apache/camel/component/aws2/s3/AWS2S3Configuration.java  | 2 +-
 .../main/java/org/apache/camel/component/aws2/sqs/Sqs2Consumer.java   | 2 +-
 .../azure/storage/datalake/integration/DataLakeProducerIT.java        | 2 ++
 .../dataformat/bindy/format/factories/BigDecimalFormatFactory.java    | 4 ++--
 .../src/main/java/org/apache/camel/jsonpath/JsonStream.java           | 2 +-
 .../micrometer/eventnotifier/MicrometerRouteEventNotifier.java        | 4 ++--
 7 files changed, 10 insertions(+), 8 deletions(-)


[camel] 01/07: (chores) camel-report-maven-plugin: apply required cast for intermediate variables

Posted by or...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 4f2de37369c6f0da56022c4d16d865aae3b949bc
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Tue Oct 4 11:33:23 2022 +0200

    (chores) camel-report-maven-plugin: apply required cast for intermediate variables
    
    Among other things, it should prevent overflows
---
 .../src/main/java/org/apache/camel/maven/ValidateMojo.java              | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/catalog/camel-report-maven-plugin/src/main/java/org/apache/camel/maven/ValidateMojo.java b/catalog/camel-report-maven-plugin/src/main/java/org/apache/camel/maven/ValidateMojo.java
index b465fe14e5e..6a32352a996 100644
--- a/catalog/camel-report-maven-plugin/src/main/java/org/apache/camel/maven/ValidateMojo.java
+++ b/catalog/camel-report-maven-plugin/src/main/java/org/apache/camel/maven/ValidateMojo.java
@@ -457,7 +457,7 @@ public class ValidateMojo extends AbstractExecMojo {
         int sedaDirectErrors = 0;
         String sedaDirectSummary = "";
         if (directOrSedaPairCheck) {
-            long sedaDirectEndpoints = countEndpointPairs(endpoints, "direct") + countEndpointPairs(endpoints, "seda");
+            long sedaDirectEndpoints = (long) countEndpointPairs(endpoints, "direct") + (long) countEndpointPairs(endpoints, "seda");
             sedaDirectErrors += validateEndpointPairs(endpoints, "direct") + validateEndpointPairs(endpoints, "seda");
             if (sedaDirectErrors == 0) {
                 sedaDirectSummary = String.format("Endpoint pair (seda/direct) validation success: (%s = pairs)", sedaDirectEndpoints);


[camel] 06/07: (chores) camel-jsonpath: apply required cast for intermediate variables

Posted by or...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 308d8f01e72c28c10727ba6781cf37a2a25505a3
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Tue Oct 4 11:52:17 2022 +0200

    (chores) camel-jsonpath: apply required cast for intermediate variables
    
    Among other things, it should prevent overflows
---
 .../src/main/java/org/apache/camel/jsonpath/JsonStream.java             | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/components/camel-jsonpath/src/main/java/org/apache/camel/jsonpath/JsonStream.java b/components/camel-jsonpath/src/main/java/org/apache/camel/jsonpath/JsonStream.java
index 790b99b7fa3..803f793a18f 100644
--- a/components/camel-jsonpath/src/main/java/org/apache/camel/jsonpath/JsonStream.java
+++ b/components/camel-jsonpath/src/main/java/org/apache/camel/jsonpath/JsonStream.java
@@ -259,7 +259,7 @@ public class JsonStream extends FilterInputStream {
     @Override
     public long skip(long n) throws IOException {
         if (inputIndex < inputEnd) {
-            long minimum = Math.min(n, inputEnd - inputIndex);
+            long minimum = Math.min(n, (long) inputEnd - inputIndex);
             for (int i = 0; i < minimum; i++) {
                 inputIndex++;
             }


[camel] 04/07: (chores) camel-azure-storage-datalake: avoid test false positives due to empty lists

Posted by or...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit e5079ded4918f4c86c8872ffb2f7f9d011852a95
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Tue Oct 4 11:43:10 2022 +0200

    (chores) camel-azure-storage-datalake: avoid test false positives due to empty lists
---
 .../azure/storage/datalake/integration/DataLakeProducerIT.java          | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/components/camel-azure/camel-azure-storage-datalake/src/test/java/org/apache/camel/component/azure/storage/datalake/integration/DataLakeProducerIT.java b/components/camel-azure/camel-azure-storage-datalake/src/test/java/org/apache/camel/component/azure/storage/datalake/integration/DataLakeProducerIT.java
index cc5bd4e53fc..132c7689d37 100644
--- a/components/camel-azure/camel-azure-storage-datalake/src/test/java/org/apache/camel/component/azure/storage/datalake/integration/DataLakeProducerIT.java
+++ b/components/camel-azure/camel-azure-storage-datalake/src/test/java/org/apache/camel/component/azure/storage/datalake/integration/DataLakeProducerIT.java
@@ -55,6 +55,7 @@ public class DataLakeProducerIT extends Base {
                     null,
                     List.class);
 
+            Assertions.assertThat(filesystems.stream().map(FileSystemItem::getName)).isNotEmpty();
             Assertions.assertThat(filesystems.stream().map(FileSystemItem::getName)).doesNotContain(fileSystemName);
         }
 
@@ -99,6 +100,7 @@ public class DataLakeProducerIT extends Base {
                     null,
                     List.class);
 
+            Assertions.assertThat(filesystems.stream().map(FileSystemItem::getName)).isNotEmpty();
             Assertions.assertThat(filesystems.stream().map(FileSystemItem::getName)).doesNotContain(fileSystemName);
         }
 


[camel] 05/07: (chores) camel-bindy: avoid subtle bugs caused by rounding errors

Posted by or...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 734b5c5a7cec1f23dad80c2758f28c8874dda36f
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Tue Oct 4 11:50:27 2022 +0200

    (chores) camel-bindy: avoid subtle bugs caused by rounding errors
    
    Floating point numbers cannot be properly represented as an IEEE 754 floating-point value.
    
    Ref.: https://wiki.sei.cmu.edu/confluence/display/java/NUM10-J.+Do+not+construct+BigDecimal+objects+from+floating-point+literals
---
 .../dataformat/bindy/format/factories/BigDecimalFormatFactory.java    | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/format/factories/BigDecimalFormatFactory.java b/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/format/factories/BigDecimalFormatFactory.java
index 197b1343b07..db0d2da62bc 100644
--- a/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/format/factories/BigDecimalFormatFactory.java
+++ b/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/format/factories/BigDecimalFormatFactory.java
@@ -54,14 +54,14 @@ public class BigDecimalFormatFactory extends AbstractFormatFactory {
         public String format(BigDecimal object) throws Exception {
             return !super.hasImpliedDecimalPosition()
                     ? super.getFormat().format(object)
-                    : super.getFormat().format(object.multiply(new BigDecimal(super.getMultiplier())));
+                    : super.getFormat().format(object.multiply(BigDecimal.valueOf(super.getMultiplier())));
         }
 
         @Override
         public BigDecimal parse(String string) throws Exception {
             BigDecimal result = new BigDecimal(string.trim());
             if (super.hasImpliedDecimalPosition()) {
-                result = result.divide(new BigDecimal(super.getMultiplier()), super.getPrecision(), RoundingMode.HALF_EVEN);
+                result = result.divide(BigDecimal.valueOf(super.getMultiplier()), super.getPrecision(), RoundingMode.HALF_EVEN);
             } else {
                 if (super.getPrecision() != -1) {
                     result = result.setScale(super.getPrecision());


[camel] 02/07: (chores) camel-aws2-sqs: simplify overly complex cast

Posted by or...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 9dbfcb217ffcf8e49b70aee77c79c40037077017
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Tue Oct 4 11:38:19 2022 +0200

    (chores) camel-aws2-sqs: simplify overly complex cast
    
    Avoid boxing and unboxing for cast purposes as Java should do that transparently for primitive types
---
 .../src/main/java/org/apache/camel/component/aws2/sqs/Sqs2Consumer.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/components/camel-aws/camel-aws2-sqs/src/main/java/org/apache/camel/component/aws2/sqs/Sqs2Consumer.java b/components/camel-aws/camel-aws2-sqs/src/main/java/org/apache/camel/component/aws2/sqs/Sqs2Consumer.java
index 768076f86ee..bc853ac882f 100644
--- a/components/camel-aws/camel-aws2-sqs/src/main/java/org/apache/camel/component/aws2/sqs/Sqs2Consumer.java
+++ b/components/camel-aws/camel-aws2-sqs/src/main/java/org/apache/camel/component/aws2/sqs/Sqs2Consumer.java
@@ -176,7 +176,7 @@ public class Sqs2Consumer extends ScheduledBatchPollingConsumer {
             if (this.scheduledExecutor != null && visibilityTimeout != null && (visibilityTimeout.intValue() / 2) > 0) {
                 int delay = visibilityTimeout.intValue() / 2;
                 int period = visibilityTimeout.intValue();
-                int repeatSeconds = Double.valueOf(visibilityTimeout.doubleValue() * 1.5).intValue();
+                int repeatSeconds = (int) (visibilityTimeout.doubleValue() * 1.5);
                 if (LOG.isDebugEnabled()) {
                     LOG.debug(
                             "Scheduled TimeoutExtender task to start after {} delay, and run with {}/{} period/repeat (seconds), to extend exchangeId: {}",


[camel] 03/07: (chores) camel-aws2-s3: apply required cast

Posted by or...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 8625905fa054bb7bac324274d3842600086c2563
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Tue Oct 4 11:39:49 2022 +0200

    (chores) camel-aws2-s3: apply required cast
---
 .../java/org/apache/camel/component/aws2/s3/AWS2S3Configuration.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/components/camel-aws/camel-aws2-s3/src/main/java/org/apache/camel/component/aws2/s3/AWS2S3Configuration.java b/components/camel-aws/camel-aws2-s3/src/main/java/org/apache/camel/component/aws2/s3/AWS2S3Configuration.java
index f07e715da45..881c5ba1ca4 100644
--- a/components/camel-aws/camel-aws2-s3/src/main/java/org/apache/camel/component/aws2/s3/AWS2S3Configuration.java
+++ b/components/camel-aws/camel-aws2-s3/src/main/java/org/apache/camel/component/aws2/s3/AWS2S3Configuration.java
@@ -67,7 +67,7 @@ public class AWS2S3Configuration implements Cloneable {
     @UriParam(label = "producer")
     private boolean multiPartUpload;
     @UriParam(label = "producer", defaultValue = "" + 25 * 1024 * 1024)
-    private long partSize = 25 * 1024 * 1024;
+    private long partSize = (long) 25 * 1024 * 1024;
     @UriParam
     private String policy;
     @UriParam(label = "producer")


[camel] 07/07: (chores) camel-micrometer: simplify overly complex cast

Posted by or...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 7e221d527fb8f936c92e390d1a2f97c429141df0
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Tue Oct 4 11:56:25 2022 +0200

    (chores) camel-micrometer: simplify overly complex cast
    
    Avoid boxing and unboxing for cast purposes as Java should do that transparently for primitive types
---
 .../micrometer/eventnotifier/MicrometerRouteEventNotifier.java        | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/components/camel-micrometer/src/main/java/org/apache/camel/component/micrometer/eventnotifier/MicrometerRouteEventNotifier.java b/components/camel-micrometer/src/main/java/org/apache/camel/component/micrometer/eventnotifier/MicrometerRouteEventNotifier.java
index f89dd9a86cc..c5617dd819b 100644
--- a/components/camel-micrometer/src/main/java/org/apache/camel/component/micrometer/eventnotifier/MicrometerRouteEventNotifier.java
+++ b/components/camel-micrometer/src/main/java/org/apache/camel/component/micrometer/eventnotifier/MicrometerRouteEventNotifier.java
@@ -47,11 +47,11 @@ public class MicrometerRouteEventNotifier extends AbstractMicrometerEventNotifie
     @Override
     protected void doStart() throws Exception {
         super.doStart();
-        Gauge.builder(namingStrategy.getRouteAddedName(), routesAdded, value -> Long.valueOf(value.get()).doubleValue())
+        Gauge.builder(namingStrategy.getRouteAddedName(), routesAdded, value -> (double) value.get())
                 .baseUnit("routes")
                 .tags(namingStrategy.getTags(getCamelContext()))
                 .register(getMeterRegistry());
-        Gauge.builder(namingStrategy.getRouteRunningName(), routesRunning, value -> Long.valueOf(value.get()).doubleValue())
+        Gauge.builder(namingStrategy.getRouteRunningName(), routesRunning, value -> (double) value.get())
                 .baseUnit("routes")
                 .tags(namingStrategy.getTags(getCamelContext()))
                 .register(getMeterRegistry());