diff --git a/component-api/src/main/java/org/talend/sdk/component/api/exception/ComponentException.java b/component-api/src/main/java/org/talend/sdk/component/api/exception/ComponentException.java index 6a98b3cd000c7..e0a56fe604a1a 100644 --- a/component-api/src/main/java/org/talend/sdk/component/api/exception/ComponentException.java +++ b/component-api/src/main/java/org/talend/sdk/component/api/exception/ComponentException.java @@ -73,10 +73,11 @@ public ComponentException(final Throwable cause) { /** * Transform all specific cause exceptions to Exception class. + * * @param t * @return An exception of type java.lang.Exception. */ - private Exception transformException(Throwable t) { + private Exception transformException(final Throwable t) { Exception cause = null; if (t.getCause() != null) { cause = transformException(t.getCause()); @@ -89,5 +90,4 @@ private Exception transformException(Throwable t) { return e; } - } diff --git a/component-api/src/test/java/org/talend/sdk/component/api/exception/ComponentExceptionTest.java b/component-api/src/test/java/org/talend/sdk/component/api/exception/ComponentExceptionTest.java index 2be23fa4becd7..12f8fdf99b138 100644 --- a/component-api/src/test/java/org/talend/sdk/component/api/exception/ComponentExceptionTest.java +++ b/component-api/src/test/java/org/talend/sdk/component/api/exception/ComponentExceptionTest.java @@ -1,3 +1,18 @@ +/** + * Copyright (C) 2006-2023 Talend Inc. - www.talend.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.talend.sdk.component.api.exception; import org.junit.jupiter.api.Assertions; @@ -8,9 +23,10 @@ class ComponentExceptionTest { @Test - public void testTypedCauseExceptionTransformation(){ + public void testTypedCauseExceptionTransformation() { IndexOutOfBoundsException indexOutOfBoundsException = new IndexOutOfBoundsException("AAA"); - IllegalArgumentException illegalArgumentException = new IllegalArgumentException("BBB", indexOutOfBoundsException); + IllegalArgumentException illegalArgumentException = + new IllegalArgumentException("BBB", indexOutOfBoundsException); IllegalStateException illegalStateException = new IllegalStateException("CCC", illegalArgumentException); ComponentException componentException = new ComponentException("DDD", illegalStateException);