View Javadoc
1   /*xml
2   <module name="Checker">
3     <module name="TreeWalker">
4       <module name="ClassDataAbstractionCoupling">
5         <property name="excludedClasses" value="HashMap, HashSet, Example1"/>
6       </module>
7     </module>
8   </module>
9   */
10  
11  package com.puppycrawl.tools.checkstyle.checks.metrics.classdataabstractioncoupling.ignore.deeper;
12  
13  import com.puppycrawl.tools.checkstyle.checks.metrics.classdataabstractioncoupling.Example2;
14  import com.puppycrawl.tools.checkstyle.checks.metrics.classdataabstractioncoupling.Example3;
15  import com.puppycrawl.tools.checkstyle.checks.metrics.classdataabstractioncoupling.ignore.Example7;
16  import com.puppycrawl.tools.checkstyle.checks.metrics.classdataabstractioncoupling.ignore.Example8;
17  
18  import java.math.BigInteger;
19  import java.util.HashMap;
20  import java.util.HashSet;
21  import java.util.Map;
22  import java.util.Set;
23  import java.util.concurrent.atomic.AtomicInteger;
24  
25  // xdoc section -- start
26  // violation below, "Class Data Abstraction Coupling is 8 (max allowed is 7)."
27  public class Example6 {
28    Set set = new HashSet(); // Ignored by default
29    Map map = new HashMap(); // Ignored by default
30  
31    AtomicInteger atomicInteger = new AtomicInteger(); // Counted 1
32    BigInteger bigInteger = new BigInteger("0");
33    Example2 example2 = new Example2();
34    Example3 example3 = new Example3();
35    Example4 example4 = new Example4();
36    Example5 example5 = new Example5();
37    Example7 example7 = new Example7();
38    Example8 example8 = new Example8(); // Counted 8
39  }
40  // xdoc section -- end