JRuby (please use github issues at http://bugs.jruby.org)
  1. JRuby (please use github issues at http://bugs.jruby.org)
  2. JRUBY-6327

java.lang.StringIndexOutOfBoundsException: String index out of range: 1

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: JRuby 1.7.0.pre1
    • Fix Version/s: JRuby 1.7.0.pre1
    • Component/s: None
    • Labels:
      None
    • Environment:
      jruby 1.7.0.dev (ruby-1.9.3-p6) (2012-01-09 dc1741a) (Java HotSpot(TM) Client VM 1.6.0_29) [darwin-i386-java]
    • Number of attachments :
      0

      Description

      It DID work on 1.6.5.

      Looks like you guys aren't checking the length.

           Failure/Error: get(:index).should redirect_to edit_current_company_url
           NativeException:
             java.lang.StringIndexOutOfBoundsException: String index out of range: 1
           # java/lang/String.java:686:in `charAt'
           # java/util/regex/Matcher.java:703:in `appendReplacement'
           # java/util/regex/Matcher.java:813:in `replaceAll'
           # java/lang/String.java:2189:in `replaceAll'
           # java/lang/String.java:686:in `charAt'
           # java/util/regex/Matcher.java:703:in `appendReplacement'
           # java/util/regex/Matcher.java:813:in `replaceAll'
           # java/lang/String.java:2189:in `replaceAll'
           # file:/Users/dnagir/.rvm/rubies/jruby-head/lib/jruby.jar!/jruby/java/java_ext/java.lang.rb:11:in `each'
           # ./app/models/user.rb:28:in `all_companies'
      

        Activity

        Hide
        Charles Oliver Nutter added a comment -

        Looks like it's failing in the "fixScalaNames" logic, but I'm surprised String.replaceAll can fail this way. Digging in.

        Show
        Charles Oliver Nutter added a comment - Looks like it's failing in the "fixScalaNames" logic, but I'm surprised String.replaceAll can fail this way. Digging in.
        Hide
        Hiro Asari added a comment -

        I believe I've fixed this in commit 3b00c39. The problem was that the method name transformation was incomplete.

        This is a common mistake. See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4689750 for another example.

        Show
        Hiro Asari added a comment - I believe I've fixed this in commit 3b00c39. The problem was that the method name transformation was incomplete. This is a common mistake. See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4689750 for another example.
        Hide
        Dmytrii Nagirniak added a comment -

        Thank Hiro for the fix. I'll give I a shot and won't report more issues

        Show
        Dmytrii Nagirniak added a comment - Thank Hiro for the fix. I'll give I a shot and won't report more issues
        Hide
        Charles Oliver Nutter added a comment -

        No no, please report any other issues you run into! These are great!

        Show
        Charles Oliver Nutter added a comment - No no, please report any other issues you run into! These are great!
        Hide
        Dmytrii Nagirniak added a comment -

        I'll do my best. I promise. I just sometimes need to work on the project too
        I just hope I wont run into many more issues.

        Show
        Dmytrii Nagirniak added a comment - I'll do my best. I promise. I just sometimes need to work on the project too I just hope I wont run into many more issues.

          People

          • Assignee:
            Hiro Asari
            Reporter:
            Dmytrii Nagirniak
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: