• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.lang.StackOverflowError - Why?

 
DC Dalton
Ranch Hand
Posts: 287
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ive built a quick object to hold log in data & extended hashtable so I can quick grab whatever info I need but for some silly reason Im getting a StackOverflowError on the overridden get Method...Ive done this several times before & never had this problem....or (as very well may be) Im having another on eof those "DUH" days! Here's the code:
public class LogInObject extends java.util.Hashtable{
public LogInObject(){

}
public LogInObject(String compName, String privledges, String realName, String lastAccess, String cage){
this.put("compName", compName);
this.put("privledges", privledges);
this.put("realName", realName);
this.put("lastAccess", lastAccess);
this.put("cageCode", cage);
}
public String get(String info){
return (String)this.get(info);
}
};
If I remove my get Method all is fine but then I have to cast the incoming data...too much of a pain......Any clue? Thanks folks
[ May 23, 2003: Message edited by: DC Dalton ]
 
Joel McNary
Bartender
Posts: 1840
Eclipse IDE Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

or (as very well may be) Im having another on eof those "DUH" days!

Don't worry, we all have those....
Try:

the "this" was calling the "get" method which was calling "this.get" which was calling "this.get" ...
[ May 23, 2003: Message edited by: Joel McNary ]
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
...Im having another on eof those "DUH" days!
Try changing this.get(info) to super.get(info).
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Damn Joel, We're gonna have to change our terminology around here from "Yingst" to "McNaryed".
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic