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

Improve error message in case of likely lack of constructor parameter names #2890

Open
cowtowncoder opened this issue Oct 16, 2020 · 0 comments

Comments

@cowtowncoder
Copy link
Member

(note: follow-up on #2852)

One nasty failure mode for annotation-less "Creator" methods (constructors) is that of Javac not compiling parameter names in byte code. While this can not be directly detected in the sense that we know that a constructor with missing names is an error (there are reasons why it might be disabled on purpose, for example; or for older code compiled with pre-Java 8, even), it seems possible to detect likely problem case:

  • One visible args-taking constructor; no default (no-args) constructor
  • No other creators (static factory method)
  • Deserialized as POJO (no custom deserializer)

and if so, we could perhaps improve exception message to suggest that lack of parameter names for otherwise visible Constructor is likely reason for issue.

@cowtowncoder cowtowncoder added to-evaluate Issue that has been received but not yet evaluated 2.13 and removed to-evaluate Issue that has been received but not yet evaluated labels Oct 16, 2020
@cowtowncoder cowtowncoder removed the 2.13 label Jul 15, 2021
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

No branches or pull requests

1 participant