Topic: Branch target offset too large for short


Lossed    -- 09-19-2007 @ 12:16 AM
  This is a CFC.

Top few inches of stack trace:

org.apache.bcel.generic.ClassGenException: Branch target offset too large for short
     at org.apache.bcel.generic.BranchInstruction.dump(BranchInstruction.java:99)
     at org.apache.bcel.generic.InstructionList.getByteCode(InstructionList.java:980)
     at org.apache.bcel.generic.MethodGen.getMethod(MethodGen.java:616)
     at coldfusion.bytecode.JavaAssembler.getBytes(JavaAssembler.java:371)


Is it my CFC is too large to compile to a short data type? Or something else?

What is the best way around this? Do I just have an include folder in the CFC folder and include chunks of code into the CFC's function/method, or is there no other solution than reducing the size of the CFC?
Maybe the original method can call another CFC's methods, so I can daisy-chain along?



Lossed
---------------------------
When the only tool you have is a hammer, everything looks like a nail Smile
-----------------------------


megan    -- 09-19-2007 @ 8:08 AM
  Hi Lossed - I've been monkeying with cfcs lately and apparently this error comes up if the cfc is too large, has a lot of repetitive code etc.  You can use cfinclude in a cfc, also you might want to tale a look at Growly Bears OOP cfc demo cfpaperclip (CF & OOP Made Easy http://www.cfpaperclip.com/ for an oop way of tying together separate smaller cfcs to see if that will help.

hth, Megan

We have art so that we shall not die of reality ~ Nietzsche


Lossed    -- 09-19-2007 @ 5:10 PM
  Thanks Megan...and Growly.
It's starting to sink in, slowly.
One word that keeps springing to mind is 'granular'.

Lossed
---------------------------
When the only tool you have is a hammer, everything looks like a nail Smile
-----------------------------


Lossed    -- 09-19-2007 @ 11:34 PM
  A little off topic here but...I was reading this CFC tips page and the part about scopes:
"Variables in the variables scope that are set within the calling page are not automatically available within the component's variables scope.".

I wonder what conditions need to be satisfied for the calling page variables-scoped vars to not be available to (or not clash with variables-scoped vars in) the CFC?

This coincides with an issue Rob helped me out with a few days ago where I was wondering how to avoid var/query name conflicts.
That quoted sentence above introduces a grey area into my understanding of the variables scope within CFC's and on calling pages. Can anyone help turn the grey into black and white please?

TIA.

Lossed
---------------------------
When the only tool you have is a hammer, everything looks like a nail Smile
-----------------------------


EasyCFM.COM Forum : http://www.easycfm.com/coldfusion/forums
Topic: http://www.easycfm.com/coldfusion/forums/viewmessages.cfm?Forum=12&Topic=12311