Cucumber Japanese example raises exception on JRuby ---------------------------------------------------
Key: JRUBY-4940 URL: http://jira.codehaus.org/browse/JRUBY-4940 Project: JRuby Issue Type: Bug Components: Parser Affects Versions: JRuby 1.5.1 Environment: OSX Java 1.5.0_24/1.6.0_20 JRuby 1.5.1 Cucumber 0.8.5 Reporter: Yoko Harada Assignee: Thomas E Enebo Attachments: CucumberRunner.java Japanese example bundled in Cucumber raises the error: load error: /Users/yoko/Projects/jruby/lib/ruby/gems/1.8/gems/cucumber-0.8.5/examples/i18n/ja/features/step_definitons/calculator_steps -- org.jcodings.exception.EncodingException: invalid code point value (LoadError) The example worked and showed the result correctly in Japanese on ruby 1.8.6 (2008-08-11 patchlevel 287) [i686-darwin]. When I tried the example using attached Program, Exception was raised in line 80 of org.jcodings.specific.BaseUTF8Encoding#codeToMbcLength(int). The int value given in this method was -27. The trace to the EncodingExcetpion was in below: {noformat} CucumberRunner [Java Application] evergreen.CucumberRunner at localhost:62834 Thread [main] (Suspended (exception EncodingException)) NonStrictUTF8Encoding(BaseUTF8Encoding).codeToMbcLength(int) line: 80 RubyYaccLexer.isMultiByteChar(int) line: 466 RubyYaccLexer.isIdentifierChar(int) line: 456 RubyYaccLexer.identifier(int, boolean) line: 1420 RubyYaccLexer.yylex() line: 1033 RubyYaccLexer.advance() line: 293 DefaultRubyParser.yyparse(RubyYaccLexer) line: 1380 DefaultRubyParser.yyparse(RubyYaccLexer, Object) line: 1332 DefaultRubyParser.parse(ParserConfiguration, LexerSource) line: 3986 Parser.parse(String, LexerSource, DynamicScope, ParserConfiguration) line: 111 Parser.parse(String, byte[], DynamicScope, ParserConfiguration) line: 82 Parser.parse(String, InputStream, DynamicScope, ParserConfiguration) line: 90 Ruby.parseFile(InputStream, String, DynamicScope, int) line: 2259 Ruby.parseFile(InputStream, String, DynamicScope) line: 2263 Ruby.loadFile(String, InputStream, boolean) line: 2540 ExternalScript.load(Ruby, boolean) line: 61 LoadService.tryLoadingLibraryOrScript(Ruby, LoadService$SearchState) line: 671 LoadService.smartLoad(String) line: 314 LoadService.require(String) line: 357 LoadService.lockAndRequire(String) line: 289 RubyKernel.requireCommon(Ruby, IRubyObject, IRubyObject, Block) line: 984 RubyKernel.require(IRubyObject, IRubyObject, Block) line: 967 RubyKernel$s_method_1_0$RUBYFRAMEDINVOKER$require.call(ThreadContext, IRubyObject, RubyModule, String, IRubyObject, Block) line: 65535 RubyKernel$s_method_1_0$RUBYFRAMEDINVOKER$require(JavaMethod$JavaMethodOneOrNBlock).call(ThreadContext, IRubyObject, RubyModule, String, IRubyObject) line: 319 AliasMethod.call(ThreadContext, IRubyObject, RubyModule, String, IRubyObject) line: 61 FunctionalCachingCallSite(CachingCallSite).cacheAndCall(IRubyObject, RubyClass, ThreadContext, IRubyObject, IRubyObject) line: 309 FunctionalCachingCallSite(CachingCallSite).call(ThreadContext, IRubyObject, IRubyObject, IRubyObject) line: 148 FCallOneArgNode.interpret(Ruby, ThreadContext, IRubyObject, Block) line: 36 NewlineNode.interpret(Ruby, ThreadContext, IRubyObject, Block) line: 104 RescueNode.executeBody(Ruby, ThreadContext, IRubyObject, Block) line: 199 RescueNode.interpretWithJavaExceptions(Ruby, ThreadContext, IRubyObject, Block) line: 118 RescueNode.interpret(Ruby, ThreadContext, IRubyObject, Block) line: 110 InterpretedMethod.call(ThreadContext, IRubyObject, RubyModule, String, IRubyObject) line: 180 FunctionalCachingCallSite(CachingCallSite).call(ThreadContext, IRubyObject, IRubyObject, IRubyObject) line: 146 FCallOneArgNode.interpret(Ruby, ThreadContext, IRubyObject, Block) line: 36 NewlineNode.interpret(Ruby, ThreadContext, IRubyObject, Block) line: 104 InterpretedMethod.call(ThreadContext, IRubyObject, RubyModule, String, IRubyObject) line: 180 NormalCachingCallSite(CachingCallSite).call(ThreadContext, IRubyObject, IRubyObject, IRubyObject) line: 146 CallOneArgNode.interpret(Ruby, ThreadContext, IRubyObject, Block) line: 57 NewlineNode.interpret(Ruby, ThreadContext, IRubyObject, Block) line: 104 BlockNode.interpret(Ruby, ThreadContext, IRubyObject, Block) line: 71 IfNode.interpret(Ruby, ThreadContext, IRubyObject, Block) line: 117 NewlineNode.interpret(Ruby, ThreadContext, IRubyObject, Block) line: 104 InterpretedMethod.call(ThreadContext, IRubyObject, RubyModule, String, IRubyObject) line: 180 FunctionalCachingCallSite(CachingCallSite).cacheAndCall(IRubyObject, RubyClass, ThreadContext, IRubyObject, IRubyObject) line: 309 FunctionalCachingCallSite(CachingCallSite).call(ThreadContext, IRubyObject, IRubyObject, IRubyObject) line: 148 FCallOneArgNode.interpret(Ruby, ThreadContext, IRubyObject, Block) line: 36 NewlineNode.interpret(Ruby, ThreadContext, IRubyObject, Block) line: 104 InterpretedBlock.evalBlockBody(ThreadContext, IRubyObject) line: 373 InterpretedBlock.yield(ThreadContext, IRubyObject, Binding, Block$Type, Block) line: 346 InterpretedBlock.yield(ThreadContext, IRubyObject, Binding, Block$Type) line: 303 Block.yield(ThreadContext, IRubyObject) line: 194 RubyArray.eachCommon(ThreadContext, Block) line: 1630 RubyArray.each(ThreadContext, Block) line: 1637 RubyArray$i_method_0_0$RUBYFRAMEDINVOKER$each.call(ThreadContext, IRubyObject, RubyModule, String, Block) line: 65535 NormalCachingCallSite(CachingCallSite).cacheAndCall(IRubyObject, RubyClass, Block, ThreadContext, IRubyObject) line: 299 NormalCachingCallSite(CachingCallSite).callBlock(ThreadContext, IRubyObject, IRubyObject, Block) line: 117 NormalCachingCallSite(CachingCallSite).call(ThreadContext, IRubyObject, IRubyObject, Block) line: 122 CallNoArgBlockNode.interpret(Ruby, ThreadContext, IRubyObject, Block) line: 64 NewlineNode.interpret(Ruby, ThreadContext, IRubyObject, Block) line: 104 BlockNode.interpret(Ruby, ThreadContext, IRubyObject, Block) line: 71 InterpretedMethod.call(ThreadContext, IRubyObject, RubyModule, String, IRubyObject) line: 180 NormalCachingCallSite(CachingCallSite).cacheAndCall(IRubyObject, RubyClass, ThreadContext, IRubyObject, IRubyObject) line: 309 NormalCachingCallSite(CachingCallSite).call(ThreadContext, IRubyObject, IRubyObject, IRubyObject) line: 148 CallOneArgNode.interpret(Ruby, ThreadContext, IRubyObject, Block) line: 57 NewlineNode.interpret(Ruby, ThreadContext, IRubyObject, Block) line: 104 BlockNode.interpret(Ruby, ThreadContext, IRubyObject, Block) line: 71 RescueNode.executeBody(Ruby, ThreadContext, IRubyObject, Block) line: 199 RescueNode.interpretWithJavaExceptions(Ruby, ThreadContext, IRubyObject, Block) line: 118 RescueNode.interpret(Ruby, ThreadContext, IRubyObject, Block) line: 110 InterpretedMethod.call(ThreadContext, IRubyObject, RubyModule, String, IRubyObject) line: 180 NormalCachingCallSite(CachingCallSite).cacheAndCall(IRubyObject, RubyClass, ThreadContext, IRubyObject, IRubyObject) line: 309 NormalCachingCallSite(CachingCallSite).call(ThreadContext, IRubyObject, IRubyObject, IRubyObject) line: 148 CallOneArgNode.interpret(Ruby, ThreadContext, IRubyObject, Block) line: 57 NewlineNode.interpret(Ruby, ThreadContext, IRubyObject, Block) line: 104 InterpretedMethod.call(ThreadContext, IRubyObject, RubyModule, String, IRubyObject) line: 180 NormalCachingCallSite(CachingCallSite).cacheAndCall(IRubyObject, RubyClass, ThreadContext, IRubyObject, IRubyObject) line: 309 NormalCachingCallSite(CachingCallSite).call(ThreadContext, IRubyObject, IRubyObject, IRubyObject) line: 148 CallOneArgNode.interpret(Ruby, ThreadContext, IRubyObject, Block) line: 57 LocalAsgnNode.interpret(Ruby, ThreadContext, IRubyObject, Block) line: 123 NewlineNode.interpret(Ruby, ThreadContext, IRubyObject, Block) line: 104 BlockNode.interpret(Ruby, ThreadContext, IRubyObject, Block) line: 71 RescueNode.executeBody(Ruby, ThreadContext, IRubyObject, Block) line: 199 RescueNode.interpretWithJavaExceptions(Ruby, ThreadContext, IRubyObject, Block) line: 118 RescueNode.interpret(Ruby, ThreadContext, IRubyObject, Block) line: 110 BeginNode.interpret(Ruby, ThreadContext, IRubyObject, Block) line: 83 NewlineNode.interpret(Ruby, ThreadContext, IRubyObject, Block) line: 104 BlockNode.interpret(Ruby, ThreadContext, IRubyObject, Block) line: 71 RootNode.interpret(Ruby, ThreadContext, IRubyObject, Block) line: 129 Ruby.loadFile(String, InputStream, boolean) line: 2540 ExternalScript.load(Ruby, boolean) line: 61 LoadService.load(String, boolean) line: 255 RubyKernel.loadCommon(IRubyObject, Ruby, IRubyObject[], Block) line: 1010 RubyKernel.load(IRubyObject, IRubyObject[], Block) line: 992 RubyKernel$s_method_0_1$RUBYFRAMEDINVOKER$load.call(ThreadContext, IRubyObject, RubyModule, String, IRubyObject[], Block) line: 65535 RubyKernel$s_method_0_1$RUBYFRAMEDINVOKER$load(DynamicMethod).call(ThreadContext, IRubyObject, RubyModule, String, IRubyObject, Block) line: 190 RubyKernel$s_method_0_1$RUBYFRAMEDINVOKER$load(DynamicMethod).call(ThreadContext, IRubyObject, RubyModule, String, IRubyObject) line: 186 FunctionalCachingCallSite(CachingCallSite).cacheAndCall(IRubyObject, RubyClass, ThreadContext, IRubyObject, IRubyObject) line: 309 FunctionalCachingCallSite(CachingCallSite).call(ThreadContext, IRubyObject, IRubyObject, IRubyObject) line: 148 FCallOneArgNode.interpret(Ruby, ThreadContext, IRubyObject, Block) line: 36 NewlineNode.interpret(Ruby, ThreadContext, IRubyObject, Block) line: 104 BlockNode.interpret(Ruby, ThreadContext, IRubyObject, Block) line: 71 RootNode.interpret(Ruby, ThreadContext, IRubyObject, Block) line: 129 Ruby.runInterpreter(Node) line: 711 EmbedEvalUnitImpl.run() line: 119 ScriptingContainer.runUnit(EmbedEvalUnit) line: 1149 ScriptingContainer.runScriptlet(PathType, String) line: 1194 CucumberRunner.<init>() line: 16 CucumberRunner.main(String[]) line: 20 {noformat} -- 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