I have a method which length exceeds the 64k JVM limit. It looks like there is no trivial way to bypass the problem, therefore I might have to refactor my code. I am a Scala noob and I would need some advice on this :
def apply = {
...
val container = Map(...<Some Really Long Input>...)
val anotherContainer = Map(...<Some Really Long Input>...)
...
}
How can I extract the content of the above variables, knowing that their content depends on some data within the apply method ?
You could abuse closures to get some of the code out of the method:
I really hope that this is automatically generated code. If it isn’t, there are many better ways to refactor your code and make it more readable and maintainable. One of them would be to put the code that creates the map into its own method and pass the data inside the
applymethod as parameters.