luigidemasi commented on code in PR #27143:
URL: https://github.com/apache/camel/pull/27143#discussion_r4147564694


##########
core/camel-core-model/src/main/java/org/apache/camel/model/SwitchDefinition.java:
##########
@@ -28,12 +28,15 @@
 
 import org.apache.camel.Expression;
 import org.apache.camel.NamedNode;
+import org.apache.camel.builder.EndpointProducerBuilder;
 import org.apache.camel.builder.ExpressionClause;
 import org.apache.camel.model.language.ExpressionDefinition;
+import org.apache.camel.spi.AsEndpointUri;
 import org.apache.camel.spi.Metadata;
 
 /** Routes a message to one fixed endpoint using a literal lookup table. */
 @Metadata(firstVersion = "4.23.0", label = "eip,routing",
+          aliases = { "decision-table", "dispatch-table", "lookup-table", 
"case" },

Review Comment:
   Removed `case` from the Switch aliases and regenerated the model and YAML 
schema metadata. Exact model names already take precedence in catalog lookup; 
the regression now also checks that an unrestricted `case` lookup returns only 
the `case` model. The existing `PART_OF` mapping still provides the complete 
Switch sample when requesting an example for `case`.
   
   _Codex on behalf of [Luigi De Masi](https://github.com/luigidemasi)._
   



##########
core/camel-core-model/src/main/java/org/apache/camel/model/SwitchCaseDefinition.java:
##########
@@ -120,11 +141,11 @@ public String getShortName() {
 
     @Override
     public String getLabel() {
-        return "case[" + value + "]";
+        return "case[" + value + " -> " + 
URISupport.sanitizeUri(getEndpointUri()) + "]";

Review Comment:
   Added the `RuntimeException` guard around URI retrieval in `getLabel()`, 
preserving diagnostic output when the builder fails. I kept label generation 
uncached so options added to a mutable endpoint builder remain visible. The 
regression covers builder failure and recovery, `toString()`, later option 
changes, and password masking; direct `getEndpointUri()` still reports the 
failure.
   
   _Codex on behalf of [Luigi De Masi](https://github.com/luigidemasi)._
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to