You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/12/24 17:59:00 UTC
[jira] [Commented] (GROOVY-8423) Private and protected inner
classes have incorrect access modifier values
[ https://issues.apache.org/jira/browse/GROOVY-8423?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16302912#comment-16302912 ]
ASF GitHub Bot commented on GROOVY-8423:
----------------------------------------
GitHub user shils opened a pull request:
https://github.com/apache/groovy/pull/648
GROOVY-8423: Do not adjust access modifiers for inner class table ent…
…ries
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/shils/groovy GROOVY-8423
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/groovy/pull/648.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #648
----
commit 9353cbf62713a63f43cb22dafd6e4c99885ea9a1
Author: Shil Sinha <sh...@...>
Date: 2017-12-24T17:54:22Z
GROOVY-8423: Do not adjust access modifiers for inner class table entries
----
> Private and protected inner classes have incorrect access modifier values
> -------------------------------------------------------------------------
>
> Key: GROOVY-8423
> URL: https://issues.apache.org/jira/browse/GROOVY-8423
> Project: Groovy
> Issue Type: Bug
> Components: Compiler
> Affects Versions: 2.4.13
> Reporter: Shil Sinha
>
> {code}
> import java.lang.reflect.Modifier
> class Foo {
> private class Private {}
> protected class Protected {}
> static void test() {
> assert Modifier.isPrivate(Private.class.getModifiers()) \\ 0
> assert Modifier.isProtected(Protected.class.getModifiers()) \\ 1
> }
> }
> Foo.test()
> {code}
> The test above fails (on both assertions). This appears to be due to the ACC_PRIVATE and ACC_PROTECTED modifiers being removed/replaced for inner classes, as well as from their inner class table entries (see GROOVY-6357). Though those modifiers aren't valid for the classes themselves, they are allowed in the inner classes table (https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.7.6).
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)