Skip to content

Commit

Permalink
Issue checkstyle#3931: Split and Organize Checkstyle inputs by Test f…
Browse files Browse the repository at this point in the history
…or NoWhitespaceAfter - completed
  • Loading branch information
Kietzmann committed Apr 12, 2017
1 parent d876c65 commit 93985ce
Show file tree
Hide file tree
Showing 8 changed files with 319 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ public class NoWhitespaceAfterCheckTest
@Override
protected String getPath(String filename) throws IOException {
return super.getPath("checks" + File.separator
+ "whitespace" + File.separator + filename);
+ "whitespace" + File.separator
+ "nowhitespaceafter" + File.separator
+ filename);
}

@Override
Expand Down Expand Up @@ -73,7 +75,7 @@ public void testDefault() throws Exception {
"136:12: " + getCheckMessage(MSG_KEY, "."),
"264:2: " + getCheckMessage(MSG_KEY, "."),
};
verify(checkConfig, getPath("InputWhitespace.java"), expected);
verify(checkConfig, getPath("InputNoWhitespaceAfterWhitespace.java"), expected);
}

@Test
Expand All @@ -84,7 +86,7 @@ public void testDotAllowLineBreaks() throws Exception {
"129:24: " + getCheckMessage(MSG_KEY, "."),
"136:12: " + getCheckMessage(MSG_KEY, "."),
};
verify(checkConfig, getPath("InputWhitespace.java"), expected);
verify(checkConfig, getPath("InputNoWhitespaceAfterWhitespace.java"), expected);
}

@Test
Expand All @@ -95,7 +97,7 @@ public void testTypecast() throws Exception {
"89:23: " + getCheckMessage(MSG_KEY, ")"),
"241:22: " + getCheckMessage(MSG_KEY, ")"),
};
verify(checkConfig, getPath("InputWhitespace.java"), expected);
verify(checkConfig, getPath("InputNoWhitespaceAfterWhitespace.java"), expected);
}

@Test
Expand Down Expand Up @@ -184,7 +186,7 @@ public void testSynchronized() throws Exception {

@Test
public void testNpe() throws Exception {
verify(checkConfig, getPath("InputNoWhiteSpaceAfterFormerNpe.java"));
verify(checkConfig, getPath("InputNoWhitespaceAfterFormerNpe.java"));
}

@Test
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.puppycrawl.tools.checkstyle.checks.whitespace;
package com.puppycrawl.tools.checkstyle.checks.whitespace.nowhitespaceafter;

public class InputNoWhitespaceAfterArrayDeclarations
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.puppycrawl.tools.checkstyle.checks.whitespace;
package com.puppycrawl.tools.checkstyle.checks.whitespace.nowhitespaceafter;

import java.util.List;

Expand All @@ -9,28 +9,28 @@ public class InputNoWhitespaceAfterArrayDeclarations2

public class A {
public int[][] create(int i, int j) {
return new int[3] [3];//incorrect, 12:30
return new int[3] [3];//incorrect, 12:30
}
}

public class B {
public int create(int i, int j) [][] {//incorrect, 17:40
return new int [3][i + j] ;//incorrect,18:27
}
}

public class C {
public int[][] create(int i, int j) {
return new int[i + j][i + j];//correct
}
}

public class D {
public int[][] [] create(int i, int j) {//incorrect, 29:23
return new int [ i + j ] [ i + j ] [ 0 ] ;//incorrect 30:27,38,51
}
}

public class E {
public int create(int i, int j, int [][] k)[] [][] {//incorrect, 35:44,56
int e [][] [] = new int[i + j] [2][i + j];//incorrect, 36:18,23,43
Expand Down Expand Up @@ -63,23 +63,23 @@ public List<Integer> create(int i, int j) [] [][] {//incorrect, 62:46,5
return null;
}
}

Object someStuff4 = boolean [].class;//incorrect, 67:32
String[][] someStuff5 = new String[4][9];
String[][] someStuff6 = (java.lang.String [] []) someStuff5;//incorrect, 69:46,50
String[][] someStuff7 = (String [][]) someStuff5;//incorrect, 70:36
//this is legal until allowLineBreaks is set to false

//this is legal until allowLineBreaks is set to false
int someStuff8
[];

//this is legal until allowLineBreaks is set to false
int[]
someStuff81;

//incorrect 81:40
Integer someStuff9[][][] = (Integer [][][]) InputNoWhitespaceAfterArrayDeclarations2.F.create(1,2);

//type arguments
List<char[]> someStuff10;//correct
List<char [][]> someStuff11;//incorrect 85:14
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.puppycrawl.tools.checkstyle.checks.whitespace.nowhitespaceafter;

public class InputNoWhitespaceAfterFormerNpe
{
private int[] getSome() {
return new int[4];
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.puppycrawl.tools.checkstyle.checks.whitespace;
package com.puppycrawl.tools.checkstyle.checks.whitespace.nowhitespaceafter;

import java.util.function.Function;
import java.util.function.IntFunction;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.puppycrawl.tools.checkstyle.checks.whitespace;
package com.puppycrawl.tools.checkstyle.checks.whitespace.nowhitespaceafter;

class InputNoWhitespaceAfterSynchronized {
void method2()
Expand Down
Loading

0 comments on commit 93985ce

Please sign in to comment.