[GitHub] groovy pull request #707: GROOVY-8509: SC error call to protected method fro...

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[GitHub] groovy pull request #707: GROOVY-8509: SC error call to protected method fro...

paulk-asert
GitHub user jwagenleitner opened a pull request:

    https://github.com/apache/groovy/pull/707

    GROOVY-8509: SC error call to protected method from same package

    Because they were closely related, this PR also includes the following:
   
    1. A change to the fix introduced by GROOVY-7883 (b1d1232770aa) to prevent filtering protected methods in the `StaticTypeCheckingVisitor` if caller is in the same package. From the same commit, removes the test `Groovy7883Bug#test3` because it should compile and the new test introduced for GROOVY-8509 in `MethodCallsStaticCompilation` takes it place.
   
    1. A change to revert groovy.sql.Sql#asList (b1d1232770aa) back to `protected`. Fix for GROOVY-7883 enforced visibility for method calls in `TypedChecked` and `CompileStatic` modes. Test was originally put in place to verify the added ClosureParams, so changed test to access method via subclass so that the access modifier for the method can remain protected. I think the spirit of the test is preserved in this case without having to open access to the method under test.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jwagenleitner/groovy 8509-SC-protected-same-package

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/groovy/pull/707.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 #707
   
----
commit c76783966f4f9198498abdf6f4696dc36e449cd5
Author: John Wagenleitner <jwagenleitner@...>
Date:   2018-05-16T14:58:23Z

    Revert change to groovy.sql.Sql#asList in commit b1d1232770aa
   
    Fix for GROOVY-7883 enforced visibility for method calls in TypedChecked
    and CompileStatic modes. Test was originally put in place to verify
    the added ClosureParams, so changed test to access method via subclass
    so that the access modifier for the method can remain protected.

commit 8821e8406adeec4d69894b739a2d941c51266c87
Author: John Wagenleitner <jwagenleitner@...>
Date:   2018-05-16T15:34:48Z

    GROOVY-8509: SC error call to protected method from same package
   
    Also includes a change to the fix introduced by GROOVY-7883 (b1d1232770aa)
    to prevent filtering protected methods in the StaticTypeCheckingVisitor if
    caller is in the same package. From the same commit, removes the test
    Groovy7883Bug#test3 because it should compile and the new test
    introduced for GROOVY-8509 in MethodCallsStaticCompilation takes it place.

----


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] groovy pull request #707: GROOVY-8509: SC error call to protected method fro...

paulk-asert
Github user asfgit closed the pull request at:

    https://github.com/apache/groovy/pull/707


---