de en es fr
Let the machine help
Light teasing, exhibition, BDSM, sissyfication, watersports... with sounds and pictures


Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Method code too large?!
PostPosted: Sun Apr 21, 2013 7:46 am 
Offline
Veteran
User avatar
After fixing other bugs, I suddenly get this error:

Code:
Error org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
General error during class generation: Method code too large!
   at org.objectweb.asm.MethodWriter.a(Unknown Source)
   at org.objectweb.asm.ClassWriter.toByteArray(Unknown Source)
   at org.codehaus.groovy.control.CompilationUnit$14.call(CompilationUnit.java:788)
   at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1027)
   at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:564)
   at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:542)
   at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:519)
   at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:279)
   at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:258)
   at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:244)
   at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:202)
   at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:212)
   at ss.EditorFrame.threadedTest(EditorFrame.java:878)
   at ss.EditorFrame.access$22(EditorFrame.java:870)
   at ss.EditorFrame$32.run(EditorFrame.java:849)
1 error


... but since it doesn't tell me where the error originates, I have no idea how to fix it (or even if this is a program glitch, not a script one). Surely it doesn't mean the SCRIPT FILE is too large, does it? It's only 102kb! If that's SexScripts' (or Groovy's) hardcoded size limit for scripts, that's a MAJOR problem that needs solving.

However, I tried a previous version of the script (96kb) and it ran fine. So I whittled my new version down to 94kb... same error! Leading me to think that it can't be a file size issue, since the larger (old) version runs and the newer one doesn't.... meaning an error in my additions to the script! But how do I find the error with no further information?

I tried splitting the script into three files, in case it WAS a size problem... but of course then the script doesn't work because values aren't carried across from one script to the other (right?)... and with more than 45 of them needing to be set at the start of the script, that's a LOT to try and convert and store in data.properties before each segment loads!!!


Last edited by Banjo on Sun Apr 21, 2013 9:00 am, edited 1 time in total.

Top
 Profile Send private message 
 
 Re: Method code too large?!
PostPosted: Sun Apr 21, 2013 8:59 am 
Offline
Site Admin
User avatar
You'll find a solution here : http://ss.deviatenow.com/viewtopic.php?p=1077#p1077

Summary : go from
Code:
setInfo(...)
//long code 1
//long code 2

to :
Code:
setInfo(...)
def longcode1 = {
//long code 1
}
longcode1()

def longcode2 = {
//long code 2
}
longcode2()


Top
 Profile Send private message 
 
 Re: Method code too large?!
PostPosted: Sun Apr 21, 2013 9:06 am 
Offline
Veteran
User avatar
doti wrote:
Ok I could replicate the error. :)
And I do not see any solution (apart splitting the script in multiple ones). :(


Wow, really? That's a MAJOR issue, then. Not being able to write scripts longer than 100kb, combined with no easy way to "jump around" (CyberMistress style) within a script, makes writing for SexScripts a real pain for anything other than short scripts. Can this not be fixed? Is it a groovy bug?

I noticed a very complicated method in that other thread of splitting files internally, but I doubt most users will want to go to all that effort to work around the bug. it's going to turn people off scripting, IMO, it it takes too much work fiddling with code rather than the "fun part" of actually writing.

EDIT:
doti wrote:
You'll find a solution here : http://ss.deviatenow.com/viewtopic.php?p=1077#p1077

Summary : go from
Code:
setInfo(...)

to :
def longcode1 = {
//long code 1
}
longcode1()

def longcode2 = {
//long code 2
}

So... does that mean simply randomly choosing sequential "blocks" of a script and dividing it up with "longcode" curly brackets? Does that fix the error? And are values carried across between "longcode" sections? How "big" should each "longcode" section be (line-wise)?


Last edited by Banjo on Sun Apr 21, 2013 9:21 am, edited 2 times in total.

Top
 Profile Send private message 
 
 Re: Method code too large?!
PostPosted: Sun Apr 21, 2013 9:13 am 
Offline
Site Admin
User avatar
Yes, it is enough. Avoid cutting blocks themselves, for example do not write this :

Code:
setInfo(...)
def longcode1 = {
   if(....){...
}
longcode1()

def longcode2 = {
   ....}
}
longcode2()



The problem with wait (error : "IllegalMonitorStateException") will be removed soon.


Top
 Profile Send private message 
 
 Re: Method code too large?!
PostPosted: Sun Apr 21, 2013 9:20 am 
Offline
Veteran
User avatar
doti wrote:
The problem with wait (error : "IllegalMonitorStateException") will be removed soon.


Okay, thanks. Split the script up and didn't get the "too big" error, but did get the IllegalMonitor" one.

So, no use working on my script anymore until it's fixed (since it won't run due to that error)? :(


Top
 Profile Send private message 
 
 Re: Method code too large?!
PostPosted: Sun Apr 21, 2013 9:40 am 
Offline
Site Admin
User avatar
This error can be easilly corrected using super.wait(...) instead of wait(...). (it won't be needed after the next release).


Top
 Profile Send private message 
 
 Re: Method code too large?!
PostPosted: Thu Apr 25, 2013 2:30 pm 
Offline
Veteran
User avatar
doti wrote:
This error can be easilly corrected using super.wait(...) instead of wait(...). (it won't be needed after the next release).


Thanks. Given how many "waits" would need to be changed (!), I'll hold off finishing my scripts until the next update or hotfix (hopefully it's an easy thing to fix and will be soon! :) ).


Top
 Profile Send private message 
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 10 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Maroon Fusion theme created by Oxydo
Software, theme modifications, phpBB modification by Doti 2010 - 2020
This website uses session cookies only.