Steps to produce:
- Create a java project that depends on yuicompressor AND Rhino
- Write any code that depends on any of the modified classes in this package: https://github.com/yui/yuicompressor/tree/master/src/org/mozilla/javascript
- You'll either get a java.lang.StringIndexOutOfBoundsException or MethodNothFoundException or something simliar.
Core of the problem is that yuicompressor leverages on a modified version of Rhino but keeps the namespace the same. So if you have a project that depends on yuicompressor AND Rhino, you are going to have namespace collision.
A crude fix would be to embed the entire Rhino library into the project and change the namespace so that it no longer conflicts with any other packages that depend on Rhino.
Here's a fork of yuicompressor that has the crude fix: https://github.com/timothy-kim/yuicompressor
However, more elegant solution would be desirable.