View Javadoc
1   /*
2   RequireThis
3   checkFields = (default)true
4   checkMethods = (default)true
5   validateOnlyOverlapping = (default)true
6   
7   
8   */
9   
10  package com.puppycrawl.tools.checkstyle.checks.coding.requirethis;
11  
12  import java.util.Arrays;
13  import java.util.Collections;
14  import java.util.Set;
15  import java.util.TreeSet;
16  import java.util.stream.Collectors;
17  
18  public class InputRequireThisMethodReferences {
19      private Set<String> tags = Collections.unmodifiableSortedSet(
20          Arrays.stream(new String[] {"br", "li", "dt", "dd", "hr", "img", "p", "td", "tr", "th",})
21              .collect(Collectors.toCollection(TreeSet::new)));
22  
23      public InputRequireThisMethodReferences(Set<String> tags) {
24          tags = tags; // violation 'Reference to instance variable 'tags' needs "this.".'
25      }
26  
27      public InputRequireThisMethodReferences() {
28          this.tags = Arrays.stream(
29              new String[] {"br", "li", "dt", "dd", "hr", "img", "p", "td", "tr", "th",})
30              .collect(Collectors.toCollection(TreeSet::new));
31      }
32  }