7241: Large concatenated string => StackOverflowError

Copying and pasting a large string into a java file between "" breaks up the string into smaller parts but causes it to throw a stackoverflowerror... I normally use this strategy to create junits for string comparsions by making it fail and then clicking on the comparison hyperlink and copying/pasting the difference...

I can artificially break the string into smaller pieces and then the intention action "Replace + with .append()" appears.. However it's not until the string is really small that I can actually use the intention action...

1 comment
Comment actions Permalink

Hello Omair-Inam Abdul-Matin,

Omair-Inam Abdul-Matin wrote:

Copying and pasting a large string into a java file between "" breaks
up the string into smaller parts but causes it to throw a
stackoverflowerror...


You could add the parameter "-Xss1024k" to your idea.vmoptions file.
This increases the stack size from 256k (I believe) to 1024k. This
should be enough for quite large strings.

Bas

0

Please sign in to leave a comment.