SI-9359 Fix InnerClass entry flags for nested Java enums#4566
Merged
adriaanm merged 2 commits intoscala:2.11.xfrom Jun 22, 2015
Merged
SI-9359 Fix InnerClass entry flags for nested Java enums#4566adriaanm merged 2 commits intoscala:2.11.xfrom
adriaanm merged 2 commits intoscala:2.11.xfrom
Conversation
The access flags in InnerClass entries for nested Java enums were basically completely off. A first step is to use the recently introduced backend method `javaClassfileFlags`, which is now moved to BCodeAsmCommon. See its doc for an explanation. Then the flags of the enum class symbol were off. An enum is - final if none of its values has a class body - abstract if it has an abstract method (https://docs.oracle.com/javase/specs/jls/se7/html/jls-8.html#jls-8.9) When using the ClassfileParser: - ENUM was never added. I guess that's just an oversight. - ABSTRACT (together with SEALED) was always added. This is to enable exhaustiveness checking, see 3f7b8b5. This is a hack and we have to go through the class members in the backend to find out if the enum actually has the `ACC_ABSTRACT` flag or not. When using the JavaParser: - FINAL was never added. - ABSTRACT was never added. This commit fixes all of the above and tests cases (Java enum read from the classfile and from source).
Member
Author
|
Review by @adriaanm. I think this should not go in 2.11.7. |
Contributor
|
ok, I reopened the milestone |
Member
Author
|
you missed the "not" 😮 |
Contributor
|
not anymore :) |
Contributor
|
thanks |
Member
Author
|
@adriaanm @SethTisue I actually changed my mind, and I do think we should get this into 2.11.7. It fixes all failures of the |
Member
Author
|
Note that the above failure ( |
Contributor
|
LGTM |
adriaanm
added a commit
that referenced
this pull request
Jun 22, 2015
SI-9359 Fix InnerClass entry flags for nested Java enums
Member
Author
|
GenBCode build turned green. |
Contributor
|
!! 🎆 !! |
This was referenced Apr 7, 2017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The access flags in InnerClass entries for nested Java enums were
basically completely off.
A first step is to use the recently introduced backend method
javaClassfileFlags, which is now moved to BCodeAsmCommon.See its doc for an explanation.
Then the flags of the enum class symbol were off. An enum is
(https://docs.oracle.com/javase/specs/jls/se7/html/jls-8.html#jls-8.9)
When using the ClassfileParser:
enable exhaustiveness checking, see 3f7b8b5. This is a hack and we
have to go through the class members in the backend to find out if
the enum actually has the
ACC_ABSTRACTflag or not.When using the JavaParser:
This commit fixes all of the above and tests cases (Java enum read
from the classfile and from source).