Skip to content

Instantly share code, notes, and snippets.

@cancerberoSgx
Last active December 14, 2015 00:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cancerberoSgx/5000883 to your computer and use it in GitHub Desktop.
Save cancerberoSgx/5000883 to your computer and use it in GitHub Desktop.
gwt bug
/**
* <p>This is a severe GWT bug. System: Gwt 2.5 rc1 - linux - firefox</p>
*
* <p>The following entry point, executed in devel mode will give a
* Java StackOverflow exception:</p>
*
* <pre>
[ERROR] [gwttest3] - Stack overflow; to increase the stack
size, use the -Xss flag at startup (java -Xss1M ...)</pre>
*
* Notes: <Br/>
*
* - this also happens with non inner classes (classes in its own files)</br>
* - For fixing this, I must modify Animal class to the following: </br>
*
<pre>
public static class Animal {
Lion lion1;
public Animal() {
//empty constructor
}
public Lion1 getLion1() {
if(lion1==null)
lion1=new Lion();
return lion1;
}
}
</pre>
*
*/
public class Gwttest3 implements EntryPoint {
public void onModuleLoad() {
testBug1();
}
public static class Animal {
Lion lion1;
public Animal() {
lion1 = new Lion();
}
}
public static class Lion extends Animal {
}
private void testBug1() {
new Animal();
System.out.println("EEEEE");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment