diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/InvalidGlobPatternException.java b/src/main/java/com/google/devtools/build/lib/skyframe/InvalidGlobPatternException.java index 852c2fbb3abc8b..9a3eedaf0995d0 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/InvalidGlobPatternException.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/InvalidGlobPatternException.java @@ -26,7 +26,7 @@ public final class InvalidGlobPatternException extends Exception { } @Override - public String toString() { - return String.format("invalid glob pattern '%s': %s", pattern, getMessage()); + public String getMessage() { + return String.format("invalid glob pattern '%s': %s", pattern, super.getMessage()); } } diff --git a/src/test/java/com/google/devtools/build/lib/packages/PackageFactoryTest.java b/src/test/java/com/google/devtools/build/lib/packages/PackageFactoryTest.java index 044b13f49859f2..5fedc206c8649b 100644 --- a/src/test/java/com/google/devtools/build/lib/packages/PackageFactoryTest.java +++ b/src/test/java/com/google/devtools/build/lib/packages/PackageFactoryTest.java @@ -727,7 +727,7 @@ public void testGlobWithSubdirMatchAndExclusion() throws Exception { @Test public void testBadCharacterInGlob() throws Exception { reporter.removeHandler(failFastHandler); - assertGlobFails("glob(['?'])", "Error in glob: wildcard ? forbidden"); + assertGlobFails("glob(['?'])", "Error in glob: invalid glob pattern '?': wildcard ? forbidden"); } @Test