Skip to content

SI-8960 Bring back the SerialVersionUID to anonymous function classes#4093

Merged
lrytz merged 1 commit intoscala:2.11.xfrom
lrytz:t8960
Nov 6, 2014
Merged

SI-8960 Bring back the SerialVersionUID to anonymous function classes#4093
lrytz merged 1 commit intoscala:2.11.xfrom
lrytz:t8960

Conversation

@lrytz
Copy link
Member

@lrytz lrytz commented Nov 5, 2014

In PR #1673 / 4267444, the annotation SerialVersionId was changed
from a StaticAnnotation to ClassFileAnnotation in order to enforce
annotation arguments to be constants. That was 2.11.0.

The ID value in the AnnotationInfo moved from args to assocs, but
the backend was not adjusted. This was fixed in PR #3711 / ecbc9d0 for
2.11.1.

Unfortunately, the synthetic AnnotationInfo that is added to anonymous
function classes still used the old constructor (args instead of
assocs), so extracting the value failed, and no field was added to
the classfile.

@lrytz
Copy link
Member Author

lrytz commented Nov 5, 2014

Review by @retronym

@scala-jenkins scala-jenkins added this to the 2.11.5 milestone Nov 5, 2014
@retronym
Copy link
Member

retronym commented Nov 5, 2014

The ghost of 4267444 comes back to haunt us again.

@retronym
Copy link
Member

retronym commented Nov 5, 2014

Let's expand the test with:

  • functions of all arities
  • specialized functions
  • partial functions in the same variations
  • check the value in the field is 0

In PR scala#1673 / 4267444, the annotation `SerialVersionId` was changed
from a `StaticAnnotation` to `ClassFileAnnotation` in order to enforce
annotation arguments to be constants. That was 2.11.0.

The ID value in the AnnotationInfo moved from `args` to `assocs`, but
the backend was not adjusted. This was fixed in PR scala#3711 / ecbc9d0 for
2.11.1.

Unfortunately, the synthetic AnnotationInfo that is added to anonymous
function classes still used the old constructor (`args` instead of
`assocs`), so extracting the value failed, and no field was added to
the classfile.
@lrytz
Copy link
Member Author

lrytz commented Nov 5, 2014

Updated the tests.

@retronym
Copy link
Member

retronym commented Nov 5, 2014

LGTM. Could you proactively add a note about this to the release notes for 2.11.5?

@lrytz
Copy link
Member Author

lrytz commented Nov 6, 2014

scala/scala-lang#247

lrytz added a commit that referenced this pull request Nov 6, 2014
SI-8960 Bring back the SerialVersionUID to anonymous function classes
@lrytz lrytz merged commit ced9e16 into scala:2.11.x Nov 6, 2014
@lrytz lrytz deleted the t8960 branch November 7, 2014 09:18
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.

3 participants