aboutsummaryrefslogtreecommitdiff
path: root/src/test/resources/com/puppycrawl/tools/checkstyle/checks/indentation/InputArrays.java
blob: c784e950117d043527e93844b333b9ed98069c1f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
package com.puppycrawl.tools.checkstyle.checks.indentation; //indent:0 exp:0

/**                                                                           //indent:0 exp:0
 * This test-input is intended to be checked using following configuration:   //indent:1 exp:1
 *                                                                            //indent:1 exp:1
 * arrayInitIndent = 2                                                        //indent:1 exp:1
 * basicOffset = 2                                                            //indent:1 exp:1
 * braceAdjustment = 0                                                        //indent:1 exp:1
 * caseIndent = 4                                                             //indent:1 exp:1
 * forceStrictCondition = false                                               //indent:1 exp:1
 * lineWrappingIndentation = 4                                                //indent:1 exp:1
 * tabWidth = 4                                                               //indent:1 exp:1
 * throwsIndent = 4                                                           //indent:1 exp:1
 *                                                                            //indent:1 exp:1
 *                                                                            //indent:1 exp:1
 */                                                                           //indent:1 exp:1
class InputArrays { //indent:0 exp:0
  /**                             //indent:2 exp:2
   * Look-up table for factories. //indent:3 exp:3
   */                             //indent:3 exp:3
  static final int[] factories = { 666666, 666666, //indent:2 exp:2
    666666, 666666, 666666, //indent:4 exp:4
    666666, 666666, 666666, //indent:4 exp:4
  }; //indent:2 exp:2

  static final int[][] factories1 = { //indent:2 exp:2
    { 666666, 666666, 666666, 666666 }, //indent:4 exp:4
    {}, // no support for SOFT keys //indent:4 exp:4
    { 666666, 666666, 666666, 666666 } //indent:4 exp:4
  }; //indent:2 exp:2

  // binomial(biggestBinomials[k], k) fits in an int, but not //indent:2 exp:2
  // binomial(biggestBinomials[k]+1,k).                       //indent:2 exp:2
  static int[] biggestBinomials = { //indent:2 exp:2
    Integer.MAX_VALUE, //indent:4 exp:4
    Integer.MAX_VALUE, //indent:4 exp:4
    65536, //indent:4 exp:4
    2345, //indent:4 exp:4
    477, //indent:4 exp:4
    193, //indent:4 exp:4
    110, //indent:4 exp:4
    75, //indent:4 exp:4
    58, //indent:4 exp:4
    49, //indent:4 exp:4
    43, //indent:4 exp:4
    39, //indent:4 exp:4
    37, //indent:4 exp:4
    35, //indent:4 exp:4
    34, //indent:4 exp:4
    34, //indent:4 exp:4
    33 //indent:4 exp:4
  }; //indent:2 exp:2

  @VisibleForTesting static final int[] halfPowersOf10 = //indent:2 exp:2
      {3, 31, 316, 3162, 31622, 316227, 3162277, 31622776, 316227766, Integer.MAX_VALUE}; //indent:6 exp:6

  public byte[] asBytes() { //indent:2 exp:2
    byte hash = 0; //indent:4 exp:4
    return new byte[] { //indent:4 exp:4
        (byte) hash, //indent:8 exp:8
        (byte) (hash >> 8), //indent:8 exp:8
        (byte) (hash >> 16), //indent:8 exp:8
        (byte) (hash >> 24), //indent:8 exp:8
        (byte) (hash >> 32), //indent:8 exp:8
        (byte) (hash >> 40), //indent:8 exp:8
        (byte) (hash >> 48), //indent:8 exp:8
        (byte) (hash >> 56)}; //indent:8 exp:8
  } //indent:2 exp:2
} //indent:0 exp:0

@interface VisibleForTesting {} //indent:0 exp:0