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

On 6 February 2011 at 15:26 Lennart Kats commented:

There’s basically three alternatives to this error:

  1. 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.
  2. 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_ia00 in it, then it won’t be in the pool, so you get a collision. Ouch.
  3. Trim the input string before doing newname calculation. 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.


On 6 February 2011 at 15:27 Lennart Kats tagged rfc

On 6 February 2011 at 16:28 Danny Groenewegen commented:

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.


On 23 March 2011 at 14:17 Lennart Kats commented:

Hm, one use case that is not supported with #3 is when you apply newname to a complete file system path, e.g. /repos/WebDSL/webdsls/trunk/src/org/webdsl/dsl/typechecker. (Is that a valid use case?)


On 8 January 2013 at 15:06 Eelco Visser tagged stratego

On 8 January 2013 at 15:07 Eelco Visser tagged minor

Log in to post comments