{"action":"created","issue":{"url":"https://api.github.com/repos/jruby/jruby/issues/3445","labels_url":"https://api.github.com/repos/jruby/jruby/issues/3445/labels{/name}","comments_url":"https://api.github.com/repos/jruby/jruby/issues/3445/comments","events_url":"https://api.github.com/repos/jruby/jruby/issues/3445/events","html_url":"https://github.com/jruby/jruby/issues/3445","id":114821575,"number":3445,"title":"Random \"string modified\" RunTime error","user":{"login":"bpardee","id":308614,"avatar_url":"https://avatars.githubusercontent.com/u/308614?v=3","gravatar_id":"","url":"https://api.github.com/users/bpardee","html_url":"https://github.com/bpardee","followers_url":"https://api.github.com/users/bpardee/followers","following_url":"https://api.github.com/users/bpardee/following{/other_user}","gists_url":"https://api.github.com/users/bpardee/gists{/gist_id}","starred_url":"https://api.github.com/users/bpardee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bpardee/subscriptions","organizations_url":"https://api.github.com/users/bpardee/orgs","repos_url":"https://api.github.com/users/bpardee/repos","events_url":"https://api.github.com/users/bpardee/events{/privacy}","received_events_url":"https://api.github.com/users/bpardee/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jruby/jruby/labels/core","name":"core","color":"02e10c"},{"url":"https://api.github.com/repos/jruby/jruby/labels/JRuby%209000","name":"JRuby 9000","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2015-11-03T13:56:00Z","updated_at":"2015-11-06T01:29:03Z","closed_at":null,"body":"In attempting to upgrade to JRuby 9030 from 1.7.19, we had to rollback because we would occasionally get the following Exception:\r\n\r\nRuntimeError string modified app/models/stability_model.rb:122 block in product_after_new\r\n```\r\n119\tdef product_after_new\r\n120\t  super\r\n121\t  self.class.has_one_list.each do |child|\r\n122\t    self.send(\"#{child}=\", child.to_s.classify.constantize.new(parent: self))\r\n123\t  end\r\n124\tend\r\n```\r\nHere is the stacktrace:\r\n```\r\nException: RuntimeError: string modified\r\norg/jruby/RubyString.java:2230:in `sub!'\r\norg/jruby/RubyString.java:2209:in `sub'\r\n/var/www/rails/connect/components/transaction/vendor/bundle/jruby/2.2.0/gems/activesupport-4.1.13/lib/active_support/inflector/methods.rb:71:in `camelize'\r\n/var/www/rails/connect/components/transaction/vendor/bundle/jruby/2.2.0/gems/activesupport-4.1.13/lib/active_support/inflector/methods.rb:160:in `classify'\r\n/var/www/rails/connect/components/transaction/vendor/bundle/jruby/2.2.0/gems/activesupport-4.1.13/lib/active_support/core_ext/string/inflections.rb:186:in `classify'\r\n/var/www/rails/connect/components/transaction/app/models/stability_model.rb:122:in `block in product_after_new’\r\n```\r\nI suspect we can fix it by changing the line as follows but I thought I would let you know about it.\r\n```\r\nself.send(\"build_#{child}\", parent: self)\r\n```"},"comment":{"url":"https://api.github.com/repos/jruby/jruby/issues/comments/154256472","html_url":"https://github.com/jruby/jruby/issues/3445#issuecomment-154256472","issue_url":"https://api.github.com/repos/jruby/jruby/issues/3445","id":154256472,"user":{"login":"reidmorrison","id":146852,"avatar_url":"https://avatars.githubusercontent.com/u/146852?v=3","gravatar_id":"","url":"https://api.github.com/users/reidmorrison","html_url":"https://github.com/reidmorrison","followers_url":"https://api.github.com/users/reidmorrison/followers","following_url":"https://api.github.com/users/reidmorrison/following{/other_user}","gists_url":"https://api.github.com/users/reidmorrison/gists{/gist_id}","starred_url":"https://api.github.com/users/reidmorrison/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reidmorrison/subscriptions","organizations_url":"https://api.github.com/users/reidmorrison/orgs","repos_url":"https://api.github.com/users/reidmorrison/repos","events_url":"https://api.github.com/users/reidmorrison/events{/privacy}","received_events_url":"https://api.github.com/users/reidmorrison/received_events","type":"User","site_admin":false},"created_at":"2015-11-06T01:29:03Z","updated_at":"2015-11-06T01:29:03Z","body":"Unfortunately we are not able to re-produce the first stack trace in out test environment, we can only reproduce the second stack trace.\r\n\r\nBy turning on the debug option `-d` the problem does not occur at all. After removing the `-d` option but keeping `backtrace.style=raw`, and reverting the code to the original listed first above, we were able to obtain the following stack trace:\r\n```\r\nJava::JavaLang::ClassCastException: org.jruby.RubyNil cannot be cast to org.jruby.RubyMatchData\r\norg.jruby.RubyString.scanOnce(RubyString.java:3671)\r\norg.jruby.RubyString.scan19(RubyString.java:3638)\r\norg.jruby.RubyString$INVOKER$i$1$0$scan19.call(RubyString$INVOKER$i$1$0$scan19.gen)\r\norg.jruby.internal.runtime.methods.JavaMethod$JavaMethodOneOrNBlock.call(JavaMethod.java:380)\r\norg.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:161)\r\nvar.www.rails.connect.components.common.config.initializers.data_cleansing.invokeOther31:scan(/var/www/rails/connect/components/common/config/initializers/data_cleansing.rb)\r\nvar.www.rails.connect.components.common.config.initializers.data_cleansing.RUBY$block$DataCleansing$0(/var/www/rails/connect/components/common/config/initializers/data_cleansing.rb:124)\r\n```"}}