You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Tobias Gesellchen (Jira)" <ji...@apache.org> on 2019/10/19 21:07:00 UTC

[jira] [Updated] (GROOVY-9282) Account for package-private methods when overriding as protected

     [ https://issues.apache.org/jira/browse/GROOVY-9282?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tobias Gesellchen updated GROOVY-9282:
--------------------------------------
    Description: 
When overriding a method as `protected` with a super method being package-private (no modifier in Java or `@PackageScope` in Groovy), compilation fails with an error similar to this:
{code:java}
...
exampleMethod(java.lang.Object -> java.lang.Object) in com.example.Child cannot override exampleMethod in com.example.Base; attempting to assign weaker access privileges; was package-private
...
{code}
This edge case seems to be missed at GROOVY-8651.

I submitted a pull request at [https://github.com/apache/groovy/pull/1038]

  was:
Overriding a method as `protected` with a super method being package-private (no modifier in Java or `@PackageScope` in Groovy), compilation fails with an error similar to this:
{code:java}
...
exampleMethod(java.lang.Object -> java.lang.Object) in com.example.Child cannot override exampleMethod in com.example.Base; attempting to assign weaker access privileges; was package-private
...
{code}

This edge case seems to be missed at GROOVY-8651.

I submitted a pull request at https://github.com/apache/groovy/pull/1038




> Account for package-private methods when overriding as protected
> ----------------------------------------------------------------
>
>                 Key: GROOVY-9282
>                 URL: https://issues.apache.org/jira/browse/GROOVY-9282
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 2.5.7, 2.5.8, 3.0.0-beta-3
>            Reporter: Tobias Gesellchen
>            Priority: Minor
>
> When overriding a method as `protected` with a super method being package-private (no modifier in Java or `@PackageScope` in Groovy), compilation fails with an error similar to this:
> {code:java}
> ...
> exampleMethod(java.lang.Object -> java.lang.Object) in com.example.Child cannot override exampleMethod in com.example.Base; attempting to assign weaker access privileges; was package-private
> ...
> {code}
> This edge case seems to be missed at GROOVY-8651.
> I submitted a pull request at [https://github.com/apache/groovy/pull/1038]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)