1 /*
2 ClassFanOutComplexity
3 max = 4
4 excludedClasses = (default)ArrayIndexOutOfBoundsException, ArrayList, Boolean, Byte, \
5 Character, Class, Collection, Deprecated, Deque, Double, DoubleStream, \
6 EnumSet, Exception, Float, FunctionalInterface, HashMap, HashSet, \
7 IllegalArgumentException, IllegalStateException, IndexOutOfBoundsException, \
8 IntStream, Integer, LinkedHashMap, LinkedHashSet, LinkedList, List, Long, \
9 LongStream, Map, NullPointerException, Object, Optional, OptionalDouble, \
10 OptionalInt, OptionalLong, Override, Queue, RuntimeException, SafeVarargs, \
11 SecurityException, Set, Short, SortedMap, SortedSet, Stream, String, \
12 StringBuffer, StringBuilder, SuppressWarnings, Throwable, TreeMap, TreeSet, \
13 UnsupportedOperationException, Void, boolean, byte, char, double, float, \
14 int, long, short, var, void
15 excludeClassesRegexps = (default)^$
16 excludedPackages = (default)
17
18
19 */
20
21 package com.puppycrawl.tools.checkstyle.checks.metrics.classfanoutcomplexity;
22
23 import java.io.File;
24 import java.io.IOException;
25 import java.io.InputStream;
26
27 public class InputClassFanOutComplexityMultiCatchBitwiseOr { // violation 'Complexity is 5'
28 public static void main(String[] args) {
29 try {
30 System.out.println(args[7]);
31 File myFile = new File("myfile.txt");
32 InputStream stream = myFile.toURL().openStream();
33 foo1();
34 } catch (ArrayIndexOutOfBoundsException | IOException
35 | SQLException | SecurityException | OneMoreException e) {
36
37 }
38 }
39
40 private static void foo1() throws RuntimeException, SQLException, OneMoreException {
41
42 }
43
44 private class SQLException extends Exception {
45
46 }
47
48 private class OneMoreException extends Exception {
49
50 }
51 }