0

I've accidentally ran a script with an infinite loop in GroovyConsole. :-\

For the sake of Murphy's Law, I haven't save my work during 3 or 4 hours. So, before killing the GroovyConsole Process, I've dumped the heap, with the hope to find a String version of the Script that was running at this moment

Do you have a hint in which Class it can hide, or if it is possible ?

Grooveek
  • 10,046
  • 1
  • 27
  • 37
  • Why didn't you just copy-paste the text of the groovy console? I will be very impressed if anyone can help with this, I cannot (sorry, and good luck). – Dónal Jun 21 '11 at 15:14

1 Answers1

2

So, it happens that my guess was right. The groovy.ui.Console Object keeps an history of changes of the script. I give you the OQL query that gave me my script back for my greatest pleasure. I ran it in VisualVM with the OQL plugin, but I could have used jhat :

select x.history.elementData[x.history.elementData.length-2].allText.toString() from groovy.ui.Console x

Despaired groovy developers who've lost their code once might be releaved now :-) For sure I am

The string version of the script may exists in another object. I'd love to hear other solutions

Grooveek
  • 10,046
  • 1
  • 27
  • 37