From 54733f93471af0cbe63e9f32a522971dbd193a3e Mon Sep 17 00:00:00 2001 From: Laurent Le Brun Date: Thu, 3 Sep 2015 13:59:44 +0000 Subject: Code cleanup -- MOS_MIGRATED_REVID=102239051 --- .../devtools/build/lib/runtime/commands/HelpCommand.java | 2 +- .../devtools/build/lib/runtime/commands/InfoCommand.java | 16 +++++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) (limited to 'src/main/java/com/google/devtools/build/lib/runtime/commands') diff --git a/src/main/java/com/google/devtools/build/lib/runtime/commands/HelpCommand.java b/src/main/java/com/google/devtools/build/lib/runtime/commands/HelpCommand.java index e168462ad2..4418f1eb8d 100644 --- a/src/main/java/com/google/devtools/build/lib/runtime/commands/HelpCommand.java +++ b/src/main/java/com/google/devtools/build/lib/runtime/commands/HelpCommand.java @@ -226,7 +226,7 @@ public final class HelpCommand implements BlazeCommand { for (String name : commands) { BlazeCommand command = commandsByName.get(name); - String varName = name.toUpperCase().replace("-", "_"); + String varName = name.toUpperCase().replace('-', '_'); Command annotation = command.getClass().getAnnotation(Command.class); if (!annotation.completion().isEmpty()) { outErr.printOutLn("BAZEL_COMMAND_" + varName + "_ARGUMENT=\"" diff --git a/src/main/java/com/google/devtools/build/lib/runtime/commands/InfoCommand.java b/src/main/java/com/google/devtools/build/lib/runtime/commands/InfoCommand.java index d1f18cefcd..1a0566b9cd 100644 --- a/src/main/java/com/google/devtools/build/lib/runtime/commands/InfoCommand.java +++ b/src/main/java/com/google/devtools/build/lib/runtime/commands/InfoCommand.java @@ -365,15 +365,13 @@ public class InfoCommand implements BlazeCommand { AllowedRuleClassInfo.Builder info = AllowedRuleClassInfo.newBuilder(); info.setPolicy(AllowedRuleClassInfo.AllowedRuleClasses.ANY); - if (attr.isStrictLabelCheckingEnabled()) { - if (attr.getAllowedRuleClassesPredicate() != Predicates.alwaysTrue()) { - info.setPolicy(AllowedRuleClassInfo.AllowedRuleClasses.SPECIFIED); - Predicate filter = attr.getAllowedRuleClassesPredicate(); - for (RuleClass otherClass : Iterables.filter( - ruleClasses, filter)) { - if (otherClass.isDocumented()) { - info.addAllowedRuleClass(otherClass.getName()); - } + if (attr.isStrictLabelCheckingEnabled() + && attr.getAllowedRuleClassesPredicate() != Predicates.alwaysTrue()) { + info.setPolicy(AllowedRuleClassInfo.AllowedRuleClasses.SPECIFIED); + Predicate filter = attr.getAllowedRuleClassesPredicate(); + for (RuleClass otherClass : Iterables.filter(ruleClasses, filter)) { + if (otherClass.isDocumented()) { + info.addAllowedRuleClass(otherClass.getName()); } } } -- cgit v1.2.3