andresteingress / gcontracts

GContracts: Programming by Contract for Groovy
http://gcontracts.org
114 stars 11 forks source link

NoSuchFieldError when debugging in IntelliJ #48

Open barneyb opened 10 years ago

barneyb commented 10 years ago

When debugging code that uses @Ensures in IntelliJ, I always receive a NoSuchFieldError from within the $_gc_computeOldVariables method for the __timeStamp__NNN_neverHappenNNNNNNNNNNNNN field that Groovy automatically adds to the underlying bytecode when compiling a class. The only solution I have found is to comment out the @Ensures annotations while debugging, and then uncomment them when I'm done.

I cracked open the generated bytecode with jd to look at what was happening, and nothing seemed inherently amiss, though I'm wondering if it's due to the fact that the timestamp fields are static, and not instance members?