bug-report-can-t-call-static-methods-on-a-java-class-instance

Christoph Sauer christoph.sauer at nuveon.de
Thu Feb 4 06:18:18 UTC 2016


Dear Attila,

i was just evaluating a switch of our huge codebase written in
Javascript using the Rhino interpreter to Nashorn. We have utility
classes written in Java that are are passed as objects to help users
write less code in JS, because that is why we use JS
in the first place. Those utility objects also contain frequently used
static methods. Your design decisions will make it impossible for us to
switch.

Not only will we have to rewrite our code, we also will have to make
separate calls to "handles" the user already has. This is against my
design decision to pursue the ideal of "literate programming". The ideal
to make code more readable is broken here.  I agree with Tal Liron
that if a programmer wants to use Java, they would. We use Javascript
because of the shorthand and the goal towards cleaner code
without loosing the power of using Java where need be.

I felt offended to be called a "Creature". I hope I misinterpret you
sentence here .
Two years have passed since this post. Have you changed your mind since?
Will there be at least a "strict" switch like suggested by tal?

Thanks
Christoph


More information about the nashorn-dev mailing list