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);
   }
 }
Beispiel #2
0
 /**
  * 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;
 }