aboutsummaryrefslogtreecommitdiff
path: root/src/test/resources/com/puppycrawl/tools/checkstyle/checks/InputArrayTypeStyle.java
blob: 546afdaf2f201c12175a0ece3338680cc28a5e61 (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
////////////////////////////////////////////////////////////////////////////////
// Test case file for checkstyle.
// Created: 2001
////////////////////////////////////////////////////////////////////////////////
package com.puppycrawl.tools.checkstyle.checks;

/**
 * Test case for ArrayTypeStyle (Java vs C)
 * @author lkuehne
 **/
public class InputArrayTypeStyle
{
    private int[] javaStyle = new int[0];
    private int cStyle[] = new int[0];

    public static void mainJava(String[] aJavaStyle)
    {
    }

    public static void mainC(String aCStyle[])
    {
        final int[] blah = new int[0];
        final boolean isOK1 = aCStyle instanceof String[];
        final boolean isOK2 = aCStyle instanceof java.lang.String[];
        final boolean isOK3 = blah instanceof int[];
    }

    public class Test
    {
        public Test[]
            variable;

        public Test[]
            getTests()
        { // we shouldn't check methods because there is no alternatives.
            return null;
        }

        public Test[] getNewTest()
        {
            return null;
        }
    }
}