mirror of
https://github.com/git/git
synced 2024-08-28 20:20:07 +00:00
![Andrei Rybak](/assets/img/avatar_default.png)
A new kind of class was added in Java 16 -- records.[1] The syntax of records is similar to regular classes with one important distinction: the name of the record class is followed by a mandatory list of components. The list is enclosed in parentheses, it may be empty, and it may immediately follow the name of the class or type parameters, if any, with or without separating whitespace. For example: public record Example(int i, String s) { } public record WithTypeParameters<A, B>(A a, B b, String s) { } record SpaceBeforeComponents (String comp1, int comp2) { } Support records in the builtin userdiff pattern for Java. Add "record" to the alternatives of keywords for kinds of class. Allowing matching various possibilities for the type parameters and/or list of the components of a record has already been covered by the preceding patch. [1] detailed description is available in "JEP 395: Records" https://openjdk.org/jeps/395 Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com> Reviewed-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 lines
159 B
Plaintext
7 lines
159 B
Plaintext
public record RIGHT (String components, String after, String space) {
|
|
static int ONE;
|
|
static int TWO;
|
|
static int THREE;
|
|
static int ChangeMe;
|
|
}
|