You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2020/07/13 16:58:46 UTC

[camel] branch 3.4.x-vargars created (now 03cda69)

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

acosentino pushed a change to branch 3.4.x-vargars
in repository https://gitbox.apache.org/repos/asf/camel.git.


      at 03cda69  fix unchecked generic for varargs compiler warning (#3997)

This branch includes the following new commits:

     new 03cda69  fix unchecked generic for varargs compiler warning (#3997)

The 1 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.



[camel] 01/01: fix unchecked generic for varargs compiler warning (#3997)

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

acosentino pushed a commit to branch 3.4.x-vargars
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 03cda69484b78bf103086e2c0650d0595d7c1a41
Author: Yasser Zamani <ya...@apache.org>
AuthorDate: Mon Jul 13 20:14:17 2020 +0430

    fix unchecked generic for varargs compiler warning (#3997)
    
    * fix unchecked generic for varargs compiler warning
    
    to get rid of "unchecked generics array creation for varargs parameter" compiler warning
    
    * make SafeVarargs annotated method final
    
    By requiring that the method is final, the developer can guarantee that the declaration he made (namely that its varargs use is safe) is actually always true (provided of course that the developer actually provided a safe varargs method), and that it wasn't actually broken by a subclass incorrectly re-implementing the method.
---
 .../src/main/java/org/apache/camel/model/TryDefinition.java            | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/model/TryDefinition.java b/core/camel-core-engine/src/main/java/org/apache/camel/model/TryDefinition.java
index 5a202c7..57cf440 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/model/TryDefinition.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/model/TryDefinition.java
@@ -88,7 +88,8 @@ public class TryDefinition extends OutputDefinition<TryDefinition> {
      * @param exceptionType the exception(s)
      * @return the try builder
      */
-    public TryDefinition doCatch(Class<? extends Throwable>... exceptionType) {
+    @SafeVarargs
+    public final TryDefinition doCatch(Class<? extends Throwable>... exceptionType) {
         popBlock();
         List<Class<? extends Throwable>> list = Arrays.asList(exceptionType);
         CatchDefinition answer = new CatchDefinition(list);