atom / language-java

Java package for Atom
Other
62 stars 58 forks source link

Support for Java 14's Record #226

Closed Eskibear closed 4 years ago

Eskibear commented 4 years ago

Description of the Change

Support "record" for Java 14, see #223 . Below are covered cases.

1. basic declaration
record Point() {}

2. having record constructor, meanwhile not breaking member functions
public record Point(int x, int y) {
  public Point {
    // validation
  }
  private void foo() { }
}

3. implemeting interfaces
public record Point(int x) implements IA, IB {}

4. defined inner another class
class A {
  record Point() {}
}

Alternate Designs

N/A

Benefits

Support to hightlight 'record'

Possible Drawbacks

new rules are limited to 'record' declarations, and are supposed not to causing any no regression.

Applicable Issues

Closes #223

Eskibear commented 4 years ago

comments addressed.

sadikovi commented 4 years ago

Thanks! Merging to master.