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 2018/06/09 00:29:00 UTC

[jira] [Commented] (GROOVY-8632) Groovy 2.5.0 fails to compile Google Java Client sample code

    [ https://issues.apache.org/jira/browse/GROOVY-8632?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16506742#comment-16506742 ] 

ASF GitHub Bot commented on GROOVY-8632:
----------------------------------------

GitHub user jwagenleitner opened a pull request:

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

    GROOVY-8632: Groovy 2.5.0 fails to compile Google Java Client sample code

    Class files can contain INNERCLASS references to other
    classes inner classes whose name may be the same name as a
    contained inner class. By storing modifiers in a map keyed
    by short class name there is a possibility for the wrong
    modifiers to be stored.
    
    Since generated class files for inner classes contain an INNERCLASS
    self reference, the logic can be simplified to look for a matching
    name and storing those access modifiers. This eliminates the need
    to search the outer class for the INNERCLASS reference.

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

    $ git pull https://github.com/jwagenleitner/groovy 8632-decompiled-cn-nested-classes

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

    https://github.com/apache/groovy/pull/753.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 #753
    
----
commit 8b0d57cfc8c600296763b31a9d9f5166b17ef4f1
Author: John Wagenleitner <jw...@...>
Date:   2018-06-09T00:00:16Z

    GROOVY-8632: Groovy 2.5.0 fails to compile Google Java Client sample code
    
    Class files can contain INNERCLASS references to other
    classes inner classes whose name may be the same name as a
    contained inner class. By storing modifiers in a map keyed
    by short class name there is a possibility for the wrong
    modifiers to be stored.
    
    Since generated class files for inner classes contain an INNERCLASS
    self reference, the logic can be simplified to look for a matching
    name and storing those access modifiers. This eliminates the need
    to search the outer class for the INNERCLASS reference.

----


> Groovy 2.5.0 fails to compile Google Java Client sample code
> ------------------------------------------------------------
>
>                 Key: GROOVY-8632
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8632
>             Project: Groovy
>          Issue Type: Bug
>          Components: Compiler
>    Affects Versions: 2.5.0
>         Environment: Ubuntu 18.04, Oracle Java 1.8.0_171-b11, Groovy 2.5.0
>            Reporter: Robert Kasanicky
>            Assignee: John Wagenleitner
>            Priority: Major
>
> I have been using Google Java Client libraries with Groovy 2.4.x successfully but now I'm getting multiple compilation errors when trying to upgrade to Groovy 2.5.0. Note that none of the classes mentioned are actually abstract although the 2.5.0 compiler clearly thinks they are.
> {code}
> @Grab('com.google.apis:google-api-services-analyticsreporting:v4-rev124-1.23.0')
> import com.google.api.services.analyticsreporting.v4.AnalyticsReporting
> @Grab('com.google.apis:google-api-services-sheets:v4-rev525-1.23.0')
> import com.google.api.services.sheets.v4.Sheets
> @Grab('com.google.apis:google-api-services-drive:v3-rev120-1.23.0')
> import com.google.api.services.drive.Drive
> final HTTP_TRANSPORT = null
> final JSON_FACTORY = null
> def requestInitializer = null
> def credential = null
> def builderAnalytics = new AnalyticsReporting.Builder(HTTP_TRANSPORT, JSON_FACTORY, requestInitializer)
> def builderSheets = new Sheets.Builder(HTTP_TRANSPORT, JSON_FACTORY, credential)
> def builderDrive = new Drive.Builder(HTTP_TRANSPORT, JSON_FACTORY, credential)
> {code}
> {code}
> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
> /home/edited/bug25.groovy: 13: You cannot create an instance from the abstract class 'com.google.api.services.analyticsreporting.v4.AnalyticsReporting$Builder'.
>  @ line 13, column 24.
>    def builderAnalytics = new AnalyticsReporting.Builder(HTTP_TRANSPORT, JSON_FACTORY, requestInitializer)
>                           ^
> /home/edited/bug25.groovy: 15: You cannot create an instance from the abstract class 'com.google.api.services.sheets.v4.Sheets$Builder'.
>  @ line 15, column 21.
>    def builderSheets = new Sheets.Builder(HTTP_TRANSPORT, JSON_FACTORY, credential)
>                        ^
> /home/edited/bug25.groovy: 17: You cannot create an instance from the abstract class 'com.google.api.services.drive.Drive$Builder'.
>  @ line 17, column 20.
>    def builderDrive = new Drive.Builder(HTTP_TRANSPORT, JSON_FACTORY, credential)
> {code}
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)