diff options
author | 2017-06-30 14:01:45 +0200 | |
---|---|---|
committer | 2017-07-03 09:04:59 +0200 | |
commit | 469079377a9561a7c2cc7a46492c44e012b9fb33 (patch) | |
tree | 7b9baaf83c2a9ee2c9a57862d833ae72d5ae9305 /src/main/java/com/google/devtools/build/lib/rules/config/ConfigFeatureFlag.java | |
parent | 86c9d942452d82a479d499ffe61695a983f16bba (diff) |
Refactor Printer
It's now easier to customize Printer if in different situations objects should
be printed differently. Also its API is cleaner now. Names of methods of SkylarkValue objects now reflect names of Skylark functions: SkylarkValue#repr and SkylarkPrintableValue#str.
PiperOrigin-RevId: 160635154
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/config/ConfigFeatureFlag.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/config/ConfigFeatureFlag.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/config/ConfigFeatureFlag.java b/src/main/java/com/google/devtools/build/lib/rules/config/ConfigFeatureFlag.java index 5b9ddb780e..79d595baf7 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/config/ConfigFeatureFlag.java +++ b/src/main/java/com/google/devtools/build/lib/rules/config/ConfigFeatureFlag.java @@ -57,7 +57,7 @@ public class ConfigFeatureFlag implements RuleConfiguredTargetFactory { ruleContext.attributeError( "allowed_values", "cannot contain duplicates, but contained multiple of " - + Printer.repr(duplicates.build(), '\'')); + + Printer.repr(duplicates.build())); } String defaultValue = ruleContext.attributes().get("default_value", STRING); @@ -65,9 +65,9 @@ public class ConfigFeatureFlag implements RuleConfiguredTargetFactory { ruleContext.attributeError( "default_value", "must be one of " - + Printer.repr(values.asList(), '\'') + + Printer.repr(values.asList()) + ", but was " - + Printer.repr(defaultValue, '\'')); + + Printer.repr(defaultValue)); } if (ruleContext.hasErrors()) { @@ -86,9 +86,9 @@ public class ConfigFeatureFlag implements RuleConfiguredTargetFactory { // TODO(mstaib): When configurationError is available, use that instead. ruleContext.ruleError( "value must be one of " - + Printer.repr(values.asList(), '\'') + + Printer.repr(values.asList()) + ", but was " - + Printer.repr(value, '\'')); + + Printer.repr(value)); return null; } |