groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul King (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (GROOVY-8415) getter method of enum is throwing en error and returning null in jdk1.8.0_151 during compiling with Groovy-2.4.13
Date Thu, 14 Dec 2017 11:29:01 GMT

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

Paul King updated GROOVY-8415:
------------------------------
    Description: 
1
down vote
favorite
I am using Groovy-2.4.13 and JDK1.8.

in Java file,I have written below enum code:
Batchjob.java

public enum Status {OK, Fail, Log}

and calling the getter as 
{code}
@Enumerated(EnumType.STRING)
    public Status getStatus(){
        return status;
    }
{code}
Under Groovy Code, I am using the enum code here like ,
BatchjobCPR.groovy
{code}
import com.wmdata.as2007.model.Systemadministration.Batchjob

Batchjob.Status status = null;
if (!failstate) {
    setStatus(Batchjob.Status.OK);
}
{code}
Problem:

Whenever I am trying to compile by using ant compile it is throwing an error

[groovyc] C:\Users\XXXXX\AppData\Local\Temp\groovy-generated-6090874347631320245-java-source\com\wmdata\as2007\batchrunner\BatchCPRUpdateJob.java:23:
error: package Batchjob does not exist [groovyc] public Batchjob.Status getStatus() { return
(Batchjob.Status)null;}

I am surprise why it is only throwing error where it calling the getStatus(which is nothing
but enum variable), rest other groovy files are compiled successfully except this.

Please suggest me how to fix this?

  was:

1
down vote
favorite
I am using Groovy-2.4.13 and JDK1.8.

in Java file,I have written below enum code:
Batchjob.java

public enum Status {OK, Fail, Log}

and calling the getter as 

@Enumerated(EnumType.STRING)
    public Status getStatus(){
        return status;
    }
Under Groovy Code, I am using the enum code here like ,
BatchjobCPR.groovy

 import com.wmdata.as2007.model.Systemadministration.Batchjob

Batchjob.Status status = null;
if (!failstate) {
    setStatus(Batchjob.Status.OK);
}
Problem:

Whenever I am trying to compile by using ant compile it is throwing an error

[groovyc] C:\Users\XXXXX\AppData\Local\Temp\groovy-generated-6090874347631320245-java-source\com\wmdata\as2007\batchrunner\BatchCPRUpdateJob.java:23:
error: package Batchjob does not exist [groovyc] public Batchjob.Status getStatus() { return
(Batchjob.Status)null;}

I am surprise why it is only throwing error where it calling the getStatus(which is nothing
but enum variable), rest other groovy files are compiled successfully except this.

Please suggest me how to fix this?


> getter method of enum is throwing en error and returning null in jdk1.8.0_151 during
compiling with Groovy-2.4.13
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-8415
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8415
>             Project: Groovy
>          Issue Type: Bug
>          Components: Ant integration, groovy-jdk
>    Affects Versions: 2.4.13
>         Environment: jdk1.8.0_151 , ant-1.10.1 & Groovy-2.413
>            Reporter: Avinash Kumar 
>              Labels: enum, groovy, jdk1_8
>
> 1
> down vote
> favorite
> I am using Groovy-2.4.13 and JDK1.8.
> in Java file,I have written below enum code:
> Batchjob.java
> public enum Status {OK, Fail, Log}
> and calling the getter as 
> {code}
> @Enumerated(EnumType.STRING)
>     public Status getStatus(){
>         return status;
>     }
> {code}
> Under Groovy Code, I am using the enum code here like ,
> BatchjobCPR.groovy
> {code}
> import com.wmdata.as2007.model.Systemadministration.Batchjob
> Batchjob.Status status = null;
> if (!failstate) {
>     setStatus(Batchjob.Status.OK);
> }
> {code}
> Problem:
> Whenever I am trying to compile by using ant compile it is throwing an error
> [groovyc] C:\Users\XXXXX\AppData\Local\Temp\groovy-generated-6090874347631320245-java-source\com\wmdata\as2007\batchrunner\BatchCPRUpdateJob.java:23:
error: package Batchjob does not exist [groovyc] public Batchjob.Status getStatus() { return
(Batchjob.Status)null;}
> I am surprise why it is only throwing error where it calling the getStatus(which is nothing
but enum variable), rest other groovy files are compiled successfully except this.
> Please suggest me how to fix this?



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message