Something still not quite right in the `scan_integer` logic. Here's the full trace: ``` HexaPDF::Content::Tokenizer#test_0007_next_token: returns a PDF keyword for a solitary plus sign: Java::JavaLang::ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1 org.jruby.dist/org.jruby.util.ByteList.get(ByteList.java:632) org.jruby.ext.strscan.RubyStringScanner.scan_base10_integer(RubyStringScanner.java:592) Users.headius.work.jruby.lib.ruby.gems.shared.gems.strscan_minus_3_dot_1_dot_5_minus_java.lib.strscan.strscan.️❤ def scan_integer #1(/Users/headius/work/jruby/lib/ruby/gems/shared/gems/strscan-3.1.5-java/lib/strscan/strscan.rb:18) Users.headius.work.hexapdf.lib.hexapdf.content.parser.️❤ def parse_number #8(lib/hexapdf/content/parser.rb:135) Users.headius.work.hexapdf.lib.hexapdf.content.parser.️❤ def parse_number #8 **(lib/hexapdf/content/parser.rb:131) org.jruby.dist/org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:139) org.jruby.dist/org.jruby.ir.targets.indy.InvokeSite.performIndirectCall(InvokeSite.java:860) org.jruby.dist/org.jruby.ir.targets.indy.InvokeSite.invoke(InvokeSite.java:808) Users.headius.work.hexapdf.lib.hexapdf.content.parser.️❤ def next_token #7(lib/hexapdf/content/parser.rb:90) Users.headius.work.hexapdf.lib.hexapdf.content.parser.️❤ def next_token #7 **(lib/hexapdf/content/parser.rb:85) org.jruby.dist/org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:139) org.jruby.dist/org.jruby.ir.targets.indy.InvokeSite.performIndirectCall(InvokeSite.java:860) org.jruby.dist/org.jruby.ir.targets.indy.InvokeSite.invoke(InvokeSite.java:785) Users.headius.work.hexapdf.test.hexapdf.common_tokenizer_tests.️❤ {} CommonTokenizerTests #12(test/hexapdf/common_tokenizer_tests.rb:124) ```
Activity
[-]ArrayIndexOutOfBounds running HexaPDF[/-][+]ArrayIndexOutOfBounds running HexaPDF tokenizer tests[/+]headius commentedon May 3, 2025
Reduced down to the HexaPDF calls:
Check if len++ walked off the end
Add tests for sign-only scan_integer calls
[-]ArrayIndexOutOfBounds running HexaPDF tokenizer tests[/-][+]jruby: ArrayIndexOutOfBounds running HexaPDF tokenizer tests[/+]Check if len++ walked off the end
Add tests for sign-only scan_integer calls
jruby: Check if len++ walked off the end (#153)
[ruby/strscan] jruby: Check if len++ walked off the end