Skip to content

Commit

Permalink
Issue checkstyle#4168: Split and Organize Checkstyle inputs by Test f…
Browse files Browse the repository at this point in the history
…or MethodTypeParameterName
  • Loading branch information
janiine committed Apr 11, 2017
1 parent 57785f3 commit b819311
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 3 deletions.
Expand Up @@ -36,7 +36,9 @@ public class MethodTypeParameterNameCheckTest
@Override
protected String getPath(String filename) throws IOException {
return super.getPath("checks" + File.separator
+ "naming" + File.separator + filename);
+ "naming" + File.separator
+ "methodtypeparametername" + File.separator
+ filename);
}

@Test
Expand All @@ -62,7 +64,7 @@ public void testMethodDefault()
"23:6: " + getCheckMessage(MSG_INVALID_PATTERN, "foo", pattern),
"28:10: " + getCheckMessage(MSG_INVALID_PATTERN, "_fo", pattern),
};
verify(checkConfig, getPath("InputTypeParameterName.java"), expected);
verify(checkConfig, getPath("InputMethodParameterName.java"), expected);
}

@Test
Expand All @@ -83,6 +85,6 @@ public void testMethodFooName()
"37:14: " + getCheckMessage(MSG_INVALID_PATTERN, "T", pattern),
//"40:14: Name 'EE' must match pattern '^foo$'.",
};
verify(checkConfig, getPath("InputTypeParameterName.java"), expected);
verify(checkConfig, getPath("InputMethodParameterName.java"), expected);
}
}
@@ -0,0 +1,62 @@
package com.puppycrawl.tools.checkstyle.checks.naming.methodtypeparametername;

import java.io.Serializable;

public class InputMethodParameterName <t>
{
public <TT> void foo() { }

<e_e> void foo(int i) {
}
}

class Other <foo extends Serializable & Cloneable> {

foo getOne() {
return null;//comment
}

<Tfo$o2T extends foo> /*comment*/Tfo$o2T getTwo(Tfo$o2T a) {
return null;
}

<foo extends Runnable> foo getShadow() {
return null;
}

static class Junk <foo> {
<_fo extends foo> void getMoreFoo() {
}
}
}

class MoreOther <T extends Cloneable> {

<E extends T> void getMore() {
new Other() {
<T> void getMoreFoo() {
}
};

// Other o = new Other() {
// <EE> void getMoreFoo() {
// }
// };
}
}

interface Boo<Input> {
Input boo();
}

interface FooInterface<T> {
T foo();
}

interface FooInterface2 {
Input foo();
}

class Input {

}

0 comments on commit b819311

Please sign in to comment.