NullPointerException when calling any method on Fiber.current if not explicitly 
in a created Fiber
--------------------------------------------------------------------------------------------------

                 Key: JRUBY-5842
                 URL: http://jira.codehaus.org/browse/JRUBY-5842
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 1.6.2
         Environment: Snow leopard 10.6.7 on a 2011 Macbook Pro
            Reporter: Daniel Azuma


I created the following "test.rb":

require 'fiber'
::Fiber.current.object_id

Executing jruby --1.9 test.rb results in:

CachingCallSite.java:388:in `pollAndGetClass': java.lang.NullPointerException
        from CachingCallSite.java:100:in `call'
        from test.rb:2:in `__file__'
        from test.rb:-1:in `load'
        from Ruby.java:671:in `runScript'
        from Ruby.java:575:in `runNormally'
        from Ruby.java:424:in `runFromMain'
        from Main.java:278:in `doRunFromMain'
        from Main.java:198:in `internalRun'
        from Main.java:164:in `run'
        from Main.java:148:in `run'
        from Main.java:128:in `main'

Note: this seems to happen only if not actually in a fiber block. Also, merely 
calling Fiber.current does not trigger the NPE. Only when you call a method 
(any method, it seems) on the resulting object do you get the NPE.

MRI seems to have a valid "global fiber" that gets returned when you call 
Fiber.current outside a fiber block.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to