String too long to be pooled (newname not allowed)
Exception in thread "main" org.strategoxt.lang.StrategoException: Exception in execution of primitive 'SSL_newname' ... Caused by: org.strategoxt.lang.StrategoException: String too long to be pooled (newname not allowed): selectpersonaffiliationfromlisttttttttttttttttttttttttttttttttttttttt2_s_ad0_selectauthorfromlist_ia00
I guess it’s performance related, but it would be better to give a warning instead and not break the application.Submitted by Danny Groenewegen on 6 February 2011 at 14:53
There’s basically three alternatives to this error:
- Pool all strings. Even the really long, file-sized ones, and all those intermediate strings the pretty printer makes. Fixes the problem but is somewhat of a performance disaster.
- Ignore the fact that the input string wasn’t pooled. If there’s an input program that already had a variable
selectpersonaffiliationfromlisttttttttttttttttttttttttttttttttttttttt2_s_ad0_selectauthorfromlist_ia00in it, then it won’t be in the pool, so you get a collision. Ouch.
- Trim the input string before doing
newnamecalculation. This may be the least harmful option, but it means that you can no longer assume that the resulting string has the input string as a prefix. If you really pass a long string to
newname, maybe you needed all those characters in the output string?
So it’s a bit of a trade off, really. #3 seems the most attractive, but should probably still be accompanied by a warning. #3 can also easily be implemented at the application level, though.
I’ll go with implementing #3 in the application. If you do decide to change
newname, you should also consider the case insensitivity fix we made for WebDSL https://svn.strategoxt.org/repos/WebDSL/webdsls/trunk/src/org/webdsl/dsl/typechecker/rename.str, so there are no collisions when using the generated name as filename on Windows and Mac.
Hm, one use case that is not supported with #3 is when you apply
newnameto a complete file system path, e.g.
/repos/WebDSL/webdsls/trunk/src/org/webdsl/dsl/typechecker. (Is that a valid use case?)
Log in to post comments