View Javadoc
1   package com.puppycrawl.tools.checkstyle.checks.indentation.indentation; //indent:0 exp:0
2   
3   /**                                                                           //indent:0 exp:0
4    * This test-input is intended to be checked using following configuration:   //indent:1 exp:1
5    *                                                                            //indent:1 exp:1
6    * arrayInitIndent = 2                                                        //indent:1 exp:1
7    * basicOffset = 2                                                            //indent:1 exp:1
8    * braceAdjustment = 0                                                        //indent:1 exp:1
9    * caseIndent = 4                                                             //indent:1 exp:1
10   * forceStrictCondition = false                                               //indent:1 exp:1
11   * lineWrappingIndentation = 4                                                //indent:1 exp:1
12   * tabWidth = 4                                                               //indent:1 exp:1
13   * throwsIndent = 4                                                           //indent:1 exp:1
14   *                                                                            //indent:1 exp:1
15   *                                                                            //indent:1 exp:1
16   */                                                                           //indent:1 exp:1
17  class InputIndentationArrays { //indent:0 exp:0
18    /**                             //indent:2 exp:2
19     * Look-up table for factories. //indent:3 exp:3
20     */                             //indent:3 exp:3
21    static final int[] factories = { 666666, 666666, //indent:2 exp:2
22      666666, 666666, 666666, //indent:4 exp:4
23      666666, 666666, 666666, //indent:4 exp:4
24    }; //indent:2 exp:2
25  
26    static final int[][] factories1 = { //indent:2 exp:2
27      { 666666, 666666, 666666, 666666 }, //indent:4 exp:4
28      {}, // no support for SOFT keys //indent:4 exp:4
29      { 666666, 666666, 666666, 666666 } //indent:4 exp:4
30    }; //indent:2 exp:2
31  
32    // binomial(biggestBinomials[k], k) fits in an int, but not //indent:2 exp:2
33    // binomial(biggestBinomials[k]+1,k).                       //indent:2 exp:2
34    static int[] biggestBinomials = { //indent:2 exp:2
35      Integer.MAX_VALUE, //indent:4 exp:4
36      Integer.MAX_VALUE, //indent:4 exp:4
37      65536, //indent:4 exp:4
38      2345, //indent:4 exp:4
39      477, //indent:4 exp:4
40      193, //indent:4 exp:4
41      110, //indent:4 exp:4
42      75, //indent:4 exp:4
43      58, //indent:4 exp:4
44      49, //indent:4 exp:4
45      43, //indent:4 exp:4
46      39, //indent:4 exp:4
47      37, //indent:4 exp:4
48      35, //indent:4 exp:4
49      34, //indent:4 exp:4
50      34, //indent:4 exp:4
51      33 //indent:4 exp:4
52    }; //indent:2 exp:2
53  
54    @VisibleForTesting static final int[] halfPowersOf10 = //indent:2 exp:2
55        {3, 31, 316, 3162, 31622, 316227, 3162277, 31622776, 316227766, Integer.MAX_VALUE}; //indent:6 exp:6
56  
57    public byte[] asBytes() { //indent:2 exp:2
58      byte hash = 0; //indent:4 exp:4
59      return new byte[] { //indent:4 exp:4
60          (byte) hash, //indent:8 exp:8
61          (byte) (hash >> 8), //indent:8 exp:8
62          (byte) (hash >> 16), //indent:8 exp:8
63          (byte) (hash >> 24), //indent:8 exp:8
64          (byte) (hash >> 32), //indent:8 exp:8
65          (byte) (hash >> 40), //indent:8 exp:8
66          (byte) (hash >> 48), //indent:8 exp:8
67          (byte) (hash >> 56)}; //indent:8 exp:8
68    } //indent:2 exp:2
69  } //indent:0 exp:0
70  
71  @interface VisibleForTesting {} //indent:0 exp:0