コード例 #1
0
 private void applyRules(String name) {
   if (applyingRulesFor.contains(name)) {
     return;
   }
   applyingRulesFor.add(name);
   try {
     for (Rule rule : rules) {
       rule.apply(name);
     }
   } finally {
     applyingRulesFor.remove(name);
   }
 }
コード例 #2
0
ファイル: TaskReportRenderer.java プロジェクト: bdruth/gradle
 /**
  * Writes a rule for the current project.
  *
  * @param rule The rule
  */
 public void addRule(Rule rule) {
   if (!currentProjectHasRules) {
     addSubheading("Rules");
   }
   getTextOutput().println(GUtil.elvis(rule.getDescription(), ""));
   currentProjectHasRules = true;
 }