forked from checkstyle/checkstyle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
InputRecordTypeParameterName.java
61 lines (43 loc) · 1.12 KB
/
InputRecordTypeParameterName.java
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
/*
RecordTypeParameterName
format = (default)^[A-Z]$
*/
//non-compiled with javac: Compilable with Java14
package com.puppycrawl.tools.checkstyle.checks.naming.recordtypeparametername;
import java.io.Serializable;
import java.util.LinkedHashMap;
import org.w3c.dom.Node;
public record InputRecordTypeParameterName<t>(Integer x, String str) { // violation
public <TT> void foo() { }
<e_e> void foo(int i) {
}
}
record Other <foo extends Serializable & Cloneable> // violation
(LinkedHashMap<String, Node> linkedHashMap) {
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 record Junk <foo>() { // violation
<_fo extends foo> void getMoreFoo() {
}
}
}
record MoreOther <T extends Cloneable>(char c, String string) {
interface Boo<Input> {
Input boo();
}
interface FooInterface<T> {
T foo();
}
interface FooInterface2 {
Input foo();
}
record Input(int x, int y) {
}
}