{"action":"closed","issue":{"url":"https://api.github.com/repos/jruby/jruby/issues/1692","labels_url":"https://api.github.com/repos/jruby/jruby/issues/1692/labels{/name}","comments_url":"https://api.github.com/repos/jruby/jruby/issues/1692/comments","events_url":"https://api.github.com/repos/jruby/jruby/issues/1692/events","html_url":"https://github.com/jruby/jruby/issues/1692","id":33379006,"number":1692,"title":"ArrayIndexOutOfBoundsException raises when Combining specific args with required","user":{"login":"taichi","id":66100,"avatar_url":"https://avatars.githubusercontent.com/u/66100?v=3","gravatar_id":"","url":"https://api.github.com/users/taichi","html_url":"https://github.com/taichi","followers_url":"https://api.github.com/users/taichi/followers","following_url":"https://api.github.com/users/taichi/following{/other_user}","gists_url":"https://api.github.com/users/taichi/gists{/gist_id}","starred_url":"https://api.github.com/users/taichi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taichi/subscriptions","organizations_url":"https://api.github.com/users/taichi/orgs","repos_url":"https://api.github.com/users/taichi/repos","events_url":"https://api.github.com/users/taichi/events{/privacy}","received_events_url":"https://api.github.com/users/taichi/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2014-05-13T08:48:37Z","updated_at":"2015-03-19T12:09:07Z","closed_at":"2015-03-19T12:09:07Z","body":"ArrayIndexOutOfBoundsException raises when Combining specific args with required.\r\n\r\ni use\r\n* jruby-complete-1.7.12\r\n* JDK1.7.0_21 or JDK1.8.0\r\n\r\ncode is \r\n\r\n```java\r\nimport org.jruby.Ruby;\r\nimport org.jruby.RubyClass;\r\nimport org.jruby.RubyObject;\r\nimport org.jruby.anno.JRubyMethod;\r\nimport org.jruby.javasupport.JavaEmbedUtils;\r\nimport org.jruby.runtime.ObjectAllocator;\r\nimport org.jruby.runtime.builtin.IRubyObject;\r\n\r\npublic class Bug extends RubyObject {\r\n\t\r\n\tpublic Bug(Ruby r, RubyClass rc) {\r\n\t\tsuper(r, rc);\r\n\t}\r\n\r\n\t@JRubyMethod(required=1)\r\n\tpublic void test(IRubyObject a, IRubyObject[] args) {}\r\n\t\r\n\tpublic static void main(String[] args) {\r\n\t\tRuby r =JavaEmbedUtils.initialize(new java.util.ArrayList<>());\r\n\t\tr.defineClass(\"Bug\", r.getObject(), new ObjectAllocator() {\r\n\t\t\t@Override\r\n\t\t\tpublic IRubyObject allocate(Ruby runtime, RubyClass klazz) {\r\n\t\t\t\treturn new Bug(runtime, klazz);\r\n\t\t\t}\r\n\t\t}).defineAnnotatedMethods(Bug.class);\r\n\t}\r\n}\r\n```\r\n\r\nthis code happen to ArrayIndexOutOfBoundsException\r\n\r\n```\r\njava.lang.ArrayIndexOutOfBoundsException: -1\r\n\tat org.jruby.org.objectweb.asm.Frame.a(Unknown Source)\r\n\tat org.jruby.org.objectweb.asm.Frame.a(Unknown Source)\r\n\tat org.jruby.org.objectweb.asm.MethodWriter.visitMaxs(Unknown Source)\r\n\tat org.jruby.compiler.impl.SkinnyMethodAdapter.end(SkinnyMethodAdapter.java:563)\r\n\tat org.jruby.compiler.impl.SkinnyMethodAdapter.end(SkinnyMethodAdapter.java:540)\r\n\tat org.jruby.internal.runtime.methods.InvocationMethodFactory.addAnnotatedMethodInvoker(InvocationMethodFactory.java:1529)\r\n\tat org.jruby.internal.runtime.methods.InvocationMethodFactory.getAnnotatedMethodClass(InvocationMethodFactory.java:845)\r\n\tat org.jruby.internal.runtime.methods.InvocationMethodFactory.getAnnotatedMethod(InvocationMethodFactory.java:894)\r\n\tat org.jruby.RubyModule.defineAnnotatedMethod(RubyModule.java:805)\r\n\tat org.jruby.RubyModule.defineAnnotatedMethod(RubyModule.java:768)\r\n\tat org.jruby.anno.TypePopulator$DefaultTypePopulator.populate(TypePopulator.java:103)\r\n\tat org.jruby.RubyModule.defineAnnotatedMethodsIndividually(RubyModule.java:762)\r\n\tat org.jruby.RubyModule.defineAnnotatedMethods(RubyModule.java:633)\r\n\tat Bug.main(Bug.java:20)\r\nException in thread \"main\" org.jruby.exceptions.RaiseException: (LoadError) -1\r\n```"}}