This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch camel-3.4.x
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/camel-3.4.x by this push:
new c0b4503 fix unchecked generic for varargs compiler warning (#3997)
(#3999)
c0b4503 is described below
commit c0b45033b555ef5df29453a0ec11e47514d611ca
Author: Andrea Cosentino <[email protected]>
AuthorDate: Mon Jul 13 18:59:05 2020 +0200
fix unchecked generic for varargs compiler warning (#3997) (#3999)
* 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.
Co-authored-by: Yasser Zamani <[email protected]>
---
.../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);