l0rdn1kk0n/wicket-bootstrap — pull request #38 by jorge-rodrigez (2012-08-08 10:14:31+00:00)
Title: Load LessEngine.class lazily

Hi,

The private static field for LessEngine in Bootstrap.java causes me some troubles due to different versions of Rhino in my libs:

2012-08-08 12:57:43,467 [main] ERROR [com.asual.lesscss.LessEngine] - LESS Engine intialization failed.
java.lang.RuntimeException: Property already exists
at org.mozilla.javascript.ScriptableObject.defineProperty(Unknown Source) ~[batik-js-1.7.jar:na]
at org.mozilla.javascript.LazilyLoadedCtor.(Unknown Source) ~[batik-js-1.7.jar:na]
at org.mozilla.javascript.ScriptRuntime.initStandardObjects(Unknown Source) ~[batik-js-1.7.jar:na]
at org.mozilla.javascript.Context.initStandardObjects(Unknown Source) ~[batik-js-1.7.jar:na]
at org.mozilla.javascript.Context.initStandardObjects(Unknown Source) ~[batik-js-1.7.jar:na]
at com.asual.lesscss.LessEngine.(LessEngine.java:67) [lesscss-engine-1.3.0.jar:na]
at com.asual.lesscss.LessEngine.(LessEngine.java:51) [lesscss-engine-1.3.0.jar:na]
at de.agilecoders.wicket.Bootstrap.(Bootstrap.java:41) [bootstrap-0.5.3-SNAPSHOT.jar:na]

I see that LessEngine is not actually used at the moment.
I've re-defined the declaration to use lazy class loading. Now LessEngine class will be load only if the application really uses LessEngine somehow.