zoran119
zoran119

Reputation: 11327

neverHappen variable in compiled classes

I changed a couple of classes in my Grails project and built a war file. I then compared the .class files from the new war to the ones in the war which was built before my changes (on a different machine, if that matters) and it turns out that many (if not all) .class files are different. Looking at the decompiled classes it seems that the differences are because of a timestamp in a variable such as this:

public static long __timeStamp__239_neverHappen1360886953029;

Does anyone know what this variable is?

Upvotes: 6

Views: 240

Answers (2)

Emmanuel Bourg
Emmanuel Bourg

Reputation: 11058

This changed in Groovy 2.4, the .class files no longer contain a timestamp field.

https://github.com/groovy/groovy-core/commit/bcdb89e

Upvotes: 1

Jayan
Jayan

Reputation: 18468

It comes from groovy class generation.

See some discussion here http://groovy.329449.n5.nabble.com/Timestamp-in-class-files-leads-to-huge-patches-td365696.html

For the sake of completeness , quoted here:-

For Groovy's own recompilation mechanism. Sources are not always in file form, so we can't "just" check the file timestamp, so we had to store that timestamp somewhere... and where better than in the class itself since that's all we have?

On Tue, Mar 3, 2009 at 10:39, Jason Dillon <[hidden email]> wrote:

Why does groovyc capture the compile timestamp? What good is that for?

Upvotes: 3

Related Questions