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 <[email protected]> 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);
