Home arrow static arrow Java Programming [Archive] - StackOverflowError- detecting cause
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - StackOverflowError- detecting cause
This topic has 16 replies on 2 pages.    « Previous | 1 | 2 |

Posts:11,200
Registered: 7/22/99
Re: StackOverflowError- detecting cause  
Jul 5, 2004 9:23 AM (reply 15 of 16)



 
I'm glad to hear you sorted it out :)
 

Posts:103
Registered: 7/4/00
Re: StackOverflowError- detecting cause  
Jul 5, 2004 9:30 AM (reply 16 of 16)



 
I had actually done something silly.

Someone had written a method called
setSomething(Vector list)

(BTW, that's not the actual name of the method, just an example.)

And I said to myself at the time, the method should take type List (so it can take either an ArrayList or a Vector).

So, I overloaded the method to create
setSomething(List list)
and altered the other one to read:
public void setSomething(Vector list){setSomething(list);}

Without thinking and realizing that this is a recursion and that just altering the parameter's type to List would have not of broken any code that was previously passing in Vector.

A.F.
 
This topic has 16 replies on 2 pages.    « Previous | 1 | 2 |