#80 StackOverflowError is thrown from NBodyForce in init()

v1.0 (example)
open
nobody
5
2011-06-29
2011-06-29
Arye Shapiro
No

During NBodyForce initialization, NBodyForce.init(ForceSimulator fsim), a StackOverflowError is thrown.
It is thrown from the recursion of the insert and insert(...) and insertHelper(...) methods.

It is caught, but doesn't not enable a "human-usable" loading of the map. It just takes too long (about 20 minutes).

Discussion

  • Arye Shapiro
    Arye Shapiro
    2011-06-29

     
    Attachments
  • Arye Shapiro
    Arye Shapiro
    2011-06-29

    A workaround:
    define a theMaxRecursionDepth (as defined in the attached NDobyForce.java file) and use it to block the depth of the recursion.
    Otherwise the recursion is blocked by the depth of the run-time stack.