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

Avinash Kumar  resolved GROOVY-8415.
------------------------------------
       Resolution: Fixed
    Fix Version/s: 2.4.13

I have used the import static of  BatchJob.Status so it is working fine for me 

> 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
>             Fix For: 2.4.13
>
>
> 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.project.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\Project\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)

Reply via email to