philburns
philburns

Reputation: 330

Groovy MissingPropertyException on final static property

The exception is I get is:

groovy.lang.MissingPropertyException: No such property: EISBN for class: de.hbznrw.ygor.export.structure.TitleStruct
Possible solutions: EISSN, ISSN, PISSN
  at groovy.lang.MetaClassImpl.invokeStaticMissingProperty(MetaClassImpl.java:1007) at groovy.lang.MetaClassImpl.getProperty(MetaClassImpl.java:1862) 
  at groovy.lang.ExpandoMetaClass.getProperty(ExpandoMetaClass.java:1155) 
  at groovy.lang.MetaClassImpl.getProperty(MetaClassImpl.java:1838) 
  at groovy.lang.ExpandoMetaClass.getProperty(ExpandoMetaClass.java:1155) 
  at groovy.lang.MetaClassImpl.getProperty(MetaClassImpl.java:3763) 
  at groovy.lang.ExpandoMetaClass.getProperty(ExpandoMetaClass.java:1167) 
  at org.codehaus.groovy.runtime.callsite.ClassMetaClassGetPropertySite.getProperty(ClassMetaClassGetPropertySite.java:51) ...

The code of TitleStruct is:

class TitleStruct {    
    static final ISSN  = 'issn'
    static final EISSN = 'eissn'
    static final PISSN = 'issn'
    static final EISBN = 'isbn'
    static final DOI = 'doi'

    // plus some getters
}

Now, isn't this weird? One of these final static properties (EISBN) is "dismissed", for no reason I can find, while three of the other properties are provided as a solution (EISSN, PISSN and ISSN). Though, there is absolutely no difference in the properties' treatment in the code. (For the investigative ones: project is here).

Obviously, the fifth property DOI is also not provided as a solution. But this is due to bigger spelling differences than the other three properties. I can see that it exists in the debugger. (EISBN is not visible in the debugger.)

Even more, same code is running on my colleague's computer - and it has been running on my machine before. The Exception occured suddenly. Therefore, I assume the problem to be located in the compiler area.

So, my question is: has anyone ever experienced a similar issue like this? Any suggestions? Thanks a lot, guys!

Upvotes: 0

Views: 930

Answers (1)

daggett
daggett

Reputation: 28634

as soon as it's grails, there is a dynamic incremental compilation of each class.

and there is a possibility of such behavior.

try to clean and rebuild whole project.

Upvotes: 1

Related Questions