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

rec pushed a commit to branch 
feature/268-UIMA-components-log-and-then-re-throw-exceptions-which-usually-leads-to-errors-being-logged-twice
in repository https://gitbox.apache.org/repos/asf/uima-uimaj.git

commit 66e648dc5fe51eb9ec6180dc23080a9be07948a6
Author: Richard Eckart de Castilho <r...@apache.org>
AuthorDate: Thu Jan 12 10:17:42 2023 +0100

    Issue #268: UIMA components log and then re-throw exceptions which usually 
leads to errors being logged twice
    
    - Remove logging statement
---
 .../analysis_engine/impl/PrimitiveAnalysisEngine_impl.java     | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git 
a/uimaj-core/src/main/java/org/apache/uima/analysis_engine/impl/PrimitiveAnalysisEngine_impl.java
 
b/uimaj-core/src/main/java/org/apache/uima/analysis_engine/impl/PrimitiveAnalysisEngine_impl.java
index b45b9a963..22fca8562 100644
--- 
a/uimaj-core/src/main/java/org/apache/uima/analysis_engine/impl/PrimitiveAnalysisEngine_impl.java
+++ 
b/uimaj-core/src/main/java/org/apache/uima/analysis_engine/impl/PrimitiveAnalysisEngine_impl.java
@@ -428,14 +428,10 @@ public class PrimitiveAnalysisEngine_impl extends 
AnalysisEngineImplBase impleme
       // log end of event
       logger.logrb(Level.FINE, CLASS_NAME.getName(), "process", 
LOG_RESOURCE_BUNDLE,
               "UIMA_analysis_engine_process_end__FINE", resourceName);
+    } catch (AnalysisEngineProcessException e) {
+      throw e;
     } catch (Exception e) {
-      // log and rethrow exception
-      logger.log(Level.SEVERE, "", e);
-      if (e instanceof AnalysisEngineProcessException) {
-        throw (AnalysisEngineProcessException) e;
-      } else {
-        throw new AnalysisEngineProcessException(e);
-      }
+      throw new AnalysisEngineProcessException(e);
     }
   }
 

Reply via email to