stack overflow while compiling

I'm trying to compile a Javabean and get the following error (with the first few lines of the stack trace). How do I go about getting this to compile?

The system is out of resources.

Consult the following stack trace for details.

java.lang.StackOverflowError

at com.sun.tools.javac.jvm.Code.markStatBegin(Code.java:1388)

at com.sun.tools.javac.jvm.Code.emitop(Code.java:310)

at com.sun.tools.javac.jvm.Code.emitop0(Code.java:411)

at com.sun.tools.javac.jvm.Items$SelfItem.load(Items.java:347)

at com.sun.tools.javac.jvm.Gen.visitIdent(Gen.java:2034)

at com.sun.tools.javac.tree.Tree$Ident.accept(Tree.java:1003)

at com.sun.tools.javac.jvm.Gen.genExpr(Gen.java:806)

at com.sun.tools.javac.jvm.Gen.visitApply(Gen.java:1601)

at com.sun.tools.javac.tree.Tree$Apply.accept(Tree.java:813)

....

....

( I do have the full stack trace saved. The above is just the first few lines)

[971 byte] By [ran123a] at [2007-10-3 2:45:43]
# 1
Blimey, never seen this before. Is the bean small enough to post? or alternatively can you try cutting it in half until you find which half causes the error - repeat until you have the offending construct.
ejpa at 2007-7-14 20:34:22 > top of Java-index,Developer Tools,Java Compiler...
# 2

I've provided below the essentials of the bean (XXBean) . It contains a reference to another bean (YYBean) - which compiles fine.

package com.blahblah;

import java.io.*;

import java.util.*;

public class XXBean {

YYBean yy;

String t[];

private boolean abc1;

private boolean abc2;

...

...many more fields

public XXBean(YYBean y) {

yy = y;

t = yy.getTopics();

for (int i=0;i<t.length;i++) {

String st = t;

if (st.equals("abc-1")) {

setABC1Checked();

}

else if (st.equals("abc-2")) {

setABC2Checked();

}

else if (st.equals("abc-3")) {

setABC3Checked();

}

....

....many more such iterations

}

}

public void setABC1Checked() {

abc1 = true;

}

public boolean isABC1Checked() {

return abc1;

}

public void setABC2Checked() {

abc2 = true;

}

public boolean isABC2Checked() {

return abc2;

}

....

.... many more such set..() and is..() methods

}>

ran123a at 2007-7-14 20:34:22 > top of Java-index,Developer Tools,Java Compiler...
# 3

It'll be the 'if' statement. You must have a lot of fields. Try to find a way of writing it that doesn't have so many 'else if's. For example if the constructor doesn't do anything after the giant 'if' statement can you just put in returns after each setXXX() and get rid of the else's? or can you use a Map<String,Boolean> instead of all the booleans?

ejpa at 2007-7-14 20:34:22 > top of Java-index,Developer Tools,Java Compiler...