Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Annotate RecordComponent. #92

Merged
merged 1 commit into from
Oct 7, 2024
Merged

Annotate RecordComponent. #92

merged 1 commit into from
Oct 7, 2024

Conversation

cpovirk
Copy link
Collaborator

@cpovirk cpovirk commented Oct 4, 2024

getGenericSignature() is not documented well, but I noticed that
getGenericType() compares the result of getGenericSignature()
against null, so that got me to verify that it can in fact return
null:

public class RecordComponentGenericSignature {
  record Rec(String s) {}

  public static void main(String[] args) {
    System.out.println(Rec.class.getRecordComponents()[0].getGenericSignature());
  }
}

`getGenericSignature()` is not documented well, but I noticed that
`getGenericType()` compares the result of `getGenericSignature()`
against `null`, so that got me to verify that it can in fact return
`null`:

```
public class RecordComponentGenericSignature {
  record Rec(String s) {}

  public static void main(String[] args) {
    System.out.println(Rec.class.getRecordComponents()[0].getGenericSignature());
  }
}
```
Copy link
Collaborator

@wmdietl wmdietl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@cpovirk cpovirk merged commit b8b7d1c into main Oct 7, 2024
18 of 30 checks passed
@cpovirk cpovirk deleted the record-component branch October 7, 2024 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants