diff options
author | 2018-04-10 19:59:46 -0700 | |
---|---|---|
committer | 2018-04-10 20:01:26 -0700 | |
commit | a65b419c25ae15fb51206f57ca47f9e7cfea0c83 (patch) | |
tree | 6357bd5f38e190dc44a17b7d14e9933bab19d8aa /src/main/java/com/google/devtools/build/lib/cmdline | |
parent | 2b533aba878698d50525826fd3e40571af87a1b9 (diff) |
Automated rollback of commit ca598fb9445627e9734c2900bc6b11430250d453.
*** Reason for rollback ***
breaks guitar tests
*** Original change description ***
Disallow labels of the form ////foo.
RELNOTES: Labels of the form ////foo are disallowed.
PiperOrigin-RevId: 192393660
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/cmdline')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/cmdline/Label.java | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/cmdline/Label.java b/src/main/java/com/google/devtools/build/lib/cmdline/Label.java index 92969c4111..f271ea6c8b 100644 --- a/src/main/java/com/google/devtools/build/lib/cmdline/Label.java +++ b/src/main/java/com/google/devtools/build/lib/cmdline/Label.java @@ -257,14 +257,11 @@ public final class Label */ private static PackageIdentifier validatePackageName(String packageIdentifier, String name) throws LabelSyntaxException { - if (packageIdentifier.startsWith("/")) { - throw new LabelSyntaxException( - "package names may not start with '/' (do you have too many '/'?)"); - } + String error = null; try { return PackageIdentifier.parse(packageIdentifier); } catch (LabelSyntaxException e) { - String error = e.getMessage(); + error = e.getMessage(); error = "invalid package name '" + packageIdentifier + "': " + error; // This check is just for a more helpful error message // i.e. valid target name, invalid package name, colon-free label form |