You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by "Ben Weidig (Jira)" <ji...@apache.org> on 2021/03/09 18:45:00 UTC

[jira] [Created] (TAP5-2666) GoogleClosureMinimizer throws exception it's March and JVM Locale is DE

Ben Weidig created TAP5-2666:
--------------------------------

             Summary: GoogleClosureMinimizer throws exception it's March and JVM Locale is DE
                 Key: TAP5-2666
                 URL: https://issues.apache.org/jira/browse/TAP5-2666
             Project: Tapestry 5
          Issue Type: Bug
            Reporter: Ben Weidig


We got some weird crashes in the GoogleClosureMinimizer...

The doMinimize-method creates a com.google.javascript.jscomp.SourceFile from an StreamableResource and uses "toString" as the filename.

The "toString" is more of a descriptive nature and contains (among other things) the "last modified" date formatted with "%tc", containing a 3-letter month:

{code}
StreamableResource<text/javascript;charset=utf-8 'core' JavaScript stack, for locale de, resources=classpath:META-INF/assets/tapestry5/require.js COMPRESSABLE lastModified: Mon Feb 15 12:35:06 CET 2021 size: 282274>
{code}

Above example is with JVM default locale "en_US".

If we set it to de, the month will become "Mär".
Thanks to the umlaut the SourceFile creation will crash, because it's not a valid filename anymore according to its validation.

The simplest fix would be changing the date output format to something more neutral, like ISO 8601.
Another possibility would be wrapping the doMinimize call in a try-catch and return the uncompressed InputStream on exceptions.




--
This message was sent by Atlassian Jira
(v8.3.4#803005)