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

acosentino pushed a commit to branch camel-4.0.x
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/camel-4.0.x by this push:
     new d0e983eff36 Revert "CAMEL-20140: Fix camel-report:route-coverage to be 
able to output coverage data (#12184)"
d0e983eff36 is described below

commit d0e983eff36b28bb6576d3198aa9ad7c8c091251
Author: Andrea Cosentino <anco...@gmail.com>
AuthorDate: Tue Jul 23 15:08:39 2024 +0200

    Revert "CAMEL-20140: Fix camel-report:route-coverage to be able to output 
coverage data (#12184)"
    
    This reverts commit e712dd0350e237828dcff18059e9770dbeae9013.
---
 .../java/org/apache/camel/parser/helper/RouteCoverageHelper.java     | 5 ++++-
 .../java/org/apache/camel/management/mbean/ManagedCamelContext.java  | 2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git 
a/catalog/camel-route-parser/src/main/java/org/apache/camel/parser/helper/RouteCoverageHelper.java
 
b/catalog/camel-route-parser/src/main/java/org/apache/camel/parser/helper/RouteCoverageHelper.java
index ec4cbcd20d3..f4e9e53a490 100644
--- 
a/catalog/camel-route-parser/src/main/java/org/apache/camel/parser/helper/RouteCoverageHelper.java
+++ 
b/catalog/camel-route-parser/src/main/java/org/apache/camel/parser/helper/RouteCoverageHelper.java
@@ -68,7 +68,10 @@ public final class RouteCoverageHelper {
                 for (int i = 0; i < routes.getLength(); i++) {
                     Node route = routes.item(i);
                     String id = 
route.getAttributes().getNamedItem("id").getNodeValue();
-                    if (routeId.equals(id)) {
+                    String customId = 
route.getAttributes().getNamedItem("customId") != null
+                            ? 
route.getAttributes().getNamedItem("customId").getNodeValue() : "false";
+                    // must be the target route and the route must be explicit 
assigned with that route id (not anonymous route)
+                    if ("true".equals(customId) && routeId.equals(id)) {
                         // parse each route and build a List<CoverageData> for 
line by line coverage data
                         AtomicInteger counter = new AtomicInteger();
                         parseRouteData(catalog, route, answer, counter);
diff --git 
a/core/camel-management/src/main/java/org/apache/camel/management/mbean/ManagedCamelContext.java
 
b/core/camel-management/src/main/java/org/apache/camel/management/mbean/ManagedCamelContext.java
index 5bc37f74959..382f54fa0c0 100644
--- 
a/core/camel-management/src/main/java/org/apache/camel/management/mbean/ManagedCamelContext.java
+++ 
b/core/camel-management/src/main/java/org/apache/camel/management/mbean/ManagedCamelContext.java
@@ -678,7 +678,7 @@ public class ManagedCamelContext extends 
ManagedPerformanceCounter implements Ti
                         getExchangesTotal(), getTotalProcessingTime()))
                 .append(">\n");
 
-        String xml = dumpRoutesAsXml(false, false);
+        String xml = dumpRoutesAsXml();
         if (xml != null) {
             // use the coverage xml parser to dump the routes and enrich with 
coverage stats
             Document dom = RouteCoverageXmlParser.parseXml(context, new 
ByteArrayInputStream(xml.getBytes()));

Reply via email to