Skip to content

jruby: ArrayIndexOutOfBounds running HexaPDF tokenizer tests #152

Closed

Description

@headius

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

  1. changed the title [-]ArrayIndexOutOfBounds running HexaPDF[/-] [+]ArrayIndexOutOfBounds running HexaPDF tokenizer tests[/+] on May 3, 2025
  2. headius commented on May 3, 2025

    @headius
    ContributorAuthor

    Reduced down to the HexaPDF calls:

    require 'hexapdf'
    tokenizer = HexaPDF::Tokenizer.new(StringIO.new("+".b))
    token = tokenizer.next_token
  3. added 2 commits that reference this issue on May 3, 2025
    7a24464
    d824b29
  4. changed the title [-]ArrayIndexOutOfBounds running HexaPDF tokenizer tests[/-] [+]jruby: ArrayIndexOutOfBounds running HexaPDF tokenizer tests[/+] on May 3, 2025
  5. added 2 commits that reference this issue on May 3, 2025
    2d51234
    2dc98a1
  6. added a commit that references this issue on May 3, 2025
    1abe4ca
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions