View Javadoc
1   /*xml
2   <module name="Checker">
3     <module name="TreeWalker">
4       <module name="ClassDataAbstractionCoupling">
5         <property name="max" value="2"/>
6       </module>
7     </module>
8   </module>
9   */
10  package com.puppycrawl.tools.checkstyle.checks.metrics.classdataabstractioncoupling.ignore.deeper;
11  
12  import java.math.BigDecimal;
13  import java.math.BigInteger;
14  import java.util.HashMap;
15  import java.util.HashSet;
16  import java.util.Map;
17  import java.util.Set;
18  import java.util.concurrent.atomic.AtomicInteger;
19  
20  // xdoc section -- start
21  // violation below, "Class Data Abstraction Coupling is 3 (max allowed is 2)."
22  public class Example4 {
23    Set set = new HashSet(); // Ignored by default
24    Map map = new HashMap(); // Ignored by default
25    AtomicInteger atomicInteger = new AtomicInteger(); // Counted 1
26    BigInteger bigInteger = new BigInteger("0");
27    BigDecimal bigDecimal = new BigDecimal("0"); // Counted 3
28  }
29  // xdoc section -- end