apigee/trireme — pull request #76 by t-beckmann (2014-07-24 09:51:45+00:00)
Title: Call empty args

I'm not sure why I run into this problem but you are not, anyways. When executing InterpretedFunction.call() passing a null as arguments array Rhino throws a NullPointerException. The JavaDoc as well as the implementation indicates that the correct usage is to pass ScriptRuntime.emptyArgs instead of null.

Trireme suffers from this in a number of places. Since I did not find all places this is done incorrectly, I worked around the issue by fixing it in RhinoContextFactory.doTopCall(). This works in most cases, but not for the HTTPParser. Certainly, the given solution is not the best one out there but it gets it done...