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

Support "JEP 118: Access to Parameter Names at Runtime" #9437

Closed
scabug opened this issue Aug 15, 2015 · 4 comments
Closed

Support "JEP 118: Access to Parameter Names at Runtime" #9437

scabug opened this issue Aug 15, 2015 · 4 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Aug 15, 2015

Since Java 8, Java supports a way to store the names of parameters in class files and retrieve them at runtime.

Scala should start/support emitting/reading these MethodParameters classfile attributes, too.
One improvement could be that named parameters could be supported for Java-defined classes.

@scabug
Copy link
Author

scabug commented Aug 15, 2015

Imported From: https://issues.scala-lang.org/browse/SI-9437?orig=1
Reporter: @soc
Affected Versions: 2.12.0-M2

@scabug
Copy link
Author

scabug commented Aug 15, 2015

@SethTisue said:
sample Java code + links to official doc at http://stackoverflow.com/a/20594685/86485

@scabug
Copy link
Author

scabug commented Jan 7, 2016

@SethTisue said:
Simon is working on this at scala/scala#4735

@SethTisue
Copy link
Member

this was a duplicate, more or less, of #5896

finaglehelper pushed a commit to twitter/finatra that referenced this issue Feb 7, 2020
Problem

Access to parameter names via Java reflection is not supported in Scala 2.11.
See: scala/bug#9437

Solution

Add a work around for the parsing of case class structures to support JSON
deserialization in Scala 2.11 and forward.

Result

Finatra case class JSON deserialization works in Scala 2.11+.

JIRA Issues: CSL-9376

Differential Revision: https://phabricator.twitter.biz/D431837
cacoco added a commit to twitter/finatra that referenced this issue May 14, 2020
Problem

Access to parameter names via Java reflection is not supported in Scala 2.11.
See: scala/bug#9437

Solution

Add a work around for the parsing of case class structures to support JSON
deserialization in Scala 2.11 and forward.

Result

Finatra case class JSON deserialization works in Scala 2.11+.

JIRA Issues: CSL-9376

Differential Revision: https://phabricator.twitter.biz/D431837
finaglehelper pushed a commit to twitter/finatra that referenced this issue Sep 16, 2020
Problem

Access to parameter names via Java reflection is not supported in Scala 2.11.
See: scala/bug#9437. This is preventing the
validation library from properly accessing the annotated constructor fields
for case class validation.

Solution

Add a workaround for accessing constructor field names in order to scan for
validation annotations.

Result

Validation works properly in Scala 2.11+.

JIRA Issues: CSL-10196

Differential Revision: https://phabricator.twitter.biz/D550724
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants