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 2016/02/05 12:09:39 UTC

[jira] [Commented] (GROOVY-7747) Generated Java stub for enum with abstract method is invalid

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

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

GitHub user paulk-asert opened a pull request:

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

    GROOVY-7747: Generated Java stub for enum with abstract method is inv…

    …alid (closes #254)

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

    $ git pull https://github.com/paulk-asert/incubator-groovy groovy7747

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

    https://github.com/apache/groovy/pull/254.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 #254
    
----
commit ae606a540a36fa4bda465e42d880595e52e0feec
Author: paulk <pa...@asert.com.au>
Date:   2016-02-05T11:07:05Z

    GROOVY-7747: Generated Java stub for enum with abstract method is invalid (closes #254)

----


> Generated Java stub for enum with abstract method is invalid
> ------------------------------------------------------------
>
>                 Key: GROOVY-7747
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7747
>             Project: Groovy
>          Issue Type: Bug
>         Environment: Groovy 2.4.5
>            Reporter: Jonathan Peterson
>            Priority: Minor
>
> When generating Java stub for enum with an abstract method results in invalid Java source. The generated source class is defined as "abstract enum".
> {code:title=EnumWithAbstractMethod.groovy}
> enum EnumWithAbstractMethod {
>     ONE {
>         @Override
>         int getInt() {
>             return 1
>         }
>     },
>     TWO {
>         @Override
>         int getInt() {
>             return 2
>         }
>     }
>     abstract int getInt()
> }
> {code}
> {code:title=Driver.groovy}
> class Driver {
>     public static void main(String[] args) {
>         def stubCompiler = new JavaStubCompilationUnit(
>             new CompilerConfiguration(),
>             new GroovyClassLoader(),
>             new File('tmp')
>         )
>         stubCompiler.addSource(new File('EnumWithAbstractMethod.groovy'))
>         stubCompiler.compile()
>     }
> }
> {code}
> {code:title=EnumWithAbstractMethod.java}
> public abstract enum EnumWithAbstractMethod
>   implements
>     groovy.lang.GroovyObject {
> ...
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)