From e9f89443b0a9840dba19d39486a251afb6d642ea Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Lesaint?= Date: Fri, 4 Dec 2015 12:18:28 +0100 Subject: [PATCH] SONAR-6997 less confusing of type key paar in logs --- .../component/DepthTraversalTypeAwareCrawler.java | 2 +- .../server/computation/component/PathAwareCrawler.java | 6 +++--- .../sonar/server/computation/component/VisitorsCrawler.java | 5 ++--- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/component/DepthTraversalTypeAwareCrawler.java b/server/sonar-server/src/main/java/org/sonar/server/computation/component/DepthTraversalTypeAwareCrawler.java index 2882a03a93b..9bb6092c181 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/computation/component/DepthTraversalTypeAwareCrawler.java +++ b/server/sonar-server/src/main/java/org/sonar/server/computation/component/DepthTraversalTypeAwareCrawler.java @@ -39,7 +39,7 @@ public final class DepthTraversalTypeAwareCrawler implements ComponentCrawler { try { visitImpl(component); } catch (RuntimeException e) { - VisitException.rethrowOrWrap(e, "Visit of Component %s:%s failed", component.getType(), component.getKey()); + VisitException.rethrowOrWrap(e, "Visit of Component {key=%s,type=%s} failed", component.getKey(), component.getType()); } } diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/component/PathAwareCrawler.java b/server/sonar-server/src/main/java/org/sonar/server/computation/component/PathAwareCrawler.java index 5c92e471a19..ebb0277de59 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/computation/component/PathAwareCrawler.java +++ b/server/sonar-server/src/main/java/org/sonar/server/computation/component/PathAwareCrawler.java @@ -51,8 +51,8 @@ public final class PathAwareCrawler implements ComponentCrawler { } catch (RuntimeException e) { VisitException.rethrowOrWrap( e, - "Visit failed for Component %s:%s%s", - component.getType(), component.getKey(), new ComponentPathPrinter<>(stack)); + "Visit failed for Component {key=%s,type=%s} %s", + component.getKey(), component.getType(), new ComponentPathPrinter<>(stack)); } } @@ -174,7 +174,7 @@ public final class PathAwareCrawler implements ComponentCrawler { @Override @Nonnull public String apply(@Nonnull PathAwareVisitor.PathElement input) { - return format("%s:%s", input.getComponent().getType(), input.getComponent().getKey()); + return format("%s(type=%s)", input.getComponent().getKey(), input.getComponent().getType()); } } } diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/component/VisitorsCrawler.java b/server/sonar-server/src/main/java/org/sonar/server/computation/component/VisitorsCrawler.java index 52ded7e54d6..f684d8e85fb 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/computation/component/VisitorsCrawler.java +++ b/server/sonar-server/src/main/java/org/sonar/server/computation/component/VisitorsCrawler.java @@ -64,9 +64,8 @@ public class VisitorsCrawler implements ComponentCrawler { } catch (RuntimeException e) { VisitException.rethrowOrWrap( e, - "Visit of Component %s:" + - "%s failed", - component.getType(), component.getKey()); + "Visit of Component {key=%s,type=%s} failed", + component.getKey(), component.getType()); } } -- 2.39.5