You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by pc...@apache.org on 2025/12/11 11:51:20 UTC

(camel) branch main updated: chore(core): catalog class check design comment

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

pcongiusti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new c38bca962bf9 chore(core): catalog class check design comment
c38bca962bf9 is described below

commit c38bca962bf98f30a4fd0231a4a99f2ae9c109ef
Author: Pasquale Congiusti <pa...@gmail.com>
AuthorDate: Thu Dec 11 12:10:55 2025 +0100

    chore(core): catalog class check design comment
---
 .../org/apache/camel/catalog/impl/AbstractCamelCatalog.java | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/core/camel-core-catalog/src/main/java/org/apache/camel/catalog/impl/AbstractCamelCatalog.java b/core/camel-core-catalog/src/main/java/org/apache/camel/catalog/impl/AbstractCamelCatalog.java
index a5599694e1b8..8411b4042fb2 100644
--- a/core/camel-core-catalog/src/main/java/org/apache/camel/catalog/impl/AbstractCamelCatalog.java
+++ b/core/camel-core-catalog/src/main/java/org/apache/camel/catalog/impl/AbstractCamelCatalog.java
@@ -761,7 +761,6 @@ public abstract class AbstractCamelCatalog {
     private Map<String, BaseOptionModel> extractApiProperties(ComponentModel model, String key, String key2) {
         Map<String, BaseOptionModel> answer = new LinkedHashMap<>();
         if (key != null) {
-            String matchKey = null;
             String dashKey = StringHelper.camelCaseToDash(key);
             String ecKey = StringHelper.asEnumConstantValue(key);
             String dashKey2 = StringHelper.camelCaseToDash(key2);
@@ -1379,8 +1378,9 @@ public abstract class AbstractCamelCatalog {
                 answer.setError(errMsg);
 
                 // is it simple parser exception then we can grab the index where the problem is
-                if (cause.getClass().getName().equals("org.apache.camel.language.simple.types.SimpleIllegalSyntaxException")
-                        || cause.getClass().getName().equals("org.apache.camel.language.simple.types.SimpleParserException")) {
+                // NOTE: those types are not available at compilation time.
+                if (cause.getClass().getName().equals("org.apache.camel.language.simple.types.SimpleIllegalSyntaxException") // NOSONAR
+                        || cause.getClass().getName().equals("org.apache.camel.language.simple.types.SimpleParserException")) { // NOSONAR
                     try {
                         // we need to grab the index field from those simple parser exceptions
                         Method method = cause.getClass().getMethod("getIndex");
@@ -1395,7 +1395,8 @@ public abstract class AbstractCamelCatalog {
                 }
 
                 // we need to grab the short message field from this simple syntax exception
-                if (cause.getClass().getName().equals("org.apache.camel.language.simple.types.SimpleIllegalSyntaxException")) {
+                // NOTE: the type is not available at compilation time.
+                if (cause.getClass().getName().equals("org.apache.camel.language.simple.types.SimpleIllegalSyntaxException")) { // NOSONAR
                     try {
                         Method method = cause.getClass().getMethod("getShortMessage");
                         Object result = method.invoke(cause);
@@ -1477,7 +1478,8 @@ public abstract class AbstractCamelCatalog {
                 answer.setError(errMsg);
 
                 // is it simple parser exception then we can grab the index where the problem is
-                if (cause.getClass().getName().equals("org.apache.camel.language.groovy.GroovyValidationException")) {
+                // NOTE: the type is not available at compilation time.
+                if (cause.getClass().getName().equals("org.apache.camel.language.groovy.GroovyValidationException")) { // NOSONAR
                     try {
                         // we need to grab the index field from those simple parser exceptions
                         Method method = cause.getClass().getMethod("getIndex");
@@ -1595,7 +1597,6 @@ public abstract class AbstractCamelCatalog {
 
         if (clazz != null && instance != null) {
             Throwable cause = null;
-            Object obj;
             try {
                 try {
                     // favour using the validate method if present as this is for tooling usage