Details

    • Type: Wish Wish
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: JRuby 1.1.2
    • Fix Version/s: JRuby 1.7.0.pre1
    • Component/s: Interpreter
    • Labels:
      None
    • Number of attachments :
      3

      Description

      Occasionally, when loading classes that have been compiled ahead-of-time, references such as require './foo.rb' is encountered by the runtime. The runtime is already smart enough to also look for foo.class when loading 'foo.rb'. It would be nice if it will also automatically consider foo.class if "./foo.rb" or ".\foo.rb" is requested.

        Activity

        Hide
        Josh Matthews added a comment -

        This fails because of a call to ClassLoader.getResource() with the resource "././foo.rb". This occurs because the load path being tested is ".", and it has a slash appended to it.

        Show
        Josh Matthews added a comment - This fails because of a call to ClassLoader.getResource() with the resource "././foo.rb". This occurs because the load path being tested is ".", and it has a slash appended to it.
        Hide
        Josh Matthews added a comment -

        Actually the previous comment is a complete lie. The answer lies in this comment at the end of findFileInClassPath():

        // Try to load from classpath without prefix. "A/b.rb" will not load as "./A/b.rb" in a jar file.

        Assuming that comment's correct, the only solution I can see is stripping off the ./ prefix.

        Show
        Josh Matthews added a comment - Actually the previous comment is a complete lie. The answer lies in this comment at the end of findFileInClassPath(): // Try to load from classpath without prefix. "A/b.rb" will not load as "./A/b.rb" in a jar file. Assuming that comment's correct, the only solution I can see is stripping off the ./ prefix.
        Hide
        Charles Oliver Nutter added a comment -

        Hmmm, sounds like there's a patch in here somewhere. Someone want to try fixing it?

        Show
        Charles Oliver Nutter added a comment - Hmmm, sounds like there's a patch in here somewhere. Someone want to try fixing it?
        Hide
        Hiro Asari added a comment -

        Charlie,

        After 2.5 years, this issue seems to be fixed. Do you agree?

        $ java -cp blah.jar:../lib/jruby.jar test
        here
        
        Show
        Hiro Asari added a comment - Charlie, After 2.5 years, this issue seems to be fixed. Do you agree? $ java -cp blah.jar:../lib/jruby.jar test here
        Hide
        Charles Oliver Nutter added a comment -

        Yeah, I agree! If it looks fixed, mark it fixed!

        Show
        Charles Oliver Nutter added a comment - Yeah, I agree! If it looks fixed, mark it fixed!

          People

          • Assignee:
            Charles Oliver Nutter
            Reporter:
            Peter K Chan
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: