Is it safe to cache the result of runtime.getClass(classname)?

I am wondering if it would be safe to store one reference to this, and
use
it over and over again?

Thanks!
Jon

Hi,

On Sat, Mar 17, 2012 at 03:13, Jonathan C. [email protected]
wrote:

I am wondering if it would be safe to store one reference to this, and use
it over and over again?

Class object varies with runtime, so no, you should not. Here’s an
example of cross runtime weird behavior:
https://github.com/jruby/jruby/commit/d659b1ad020a893fa82389decf319c540412fa3d

That’s also a problem jruby-ossl has… Want to clean-up that someday.

Best regards,
Hiroshi N.

Thanks Hiroshi!

2012/3/18 Hiroshi N. [email protected]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs