Menu

#8 ArrayIndexOutOfBoundsException with getContentFragment

1.0
closed
fixed (1)
2016-11-02
2016-10-20
Rainette
No

Hi,

I'm using VDT XML in production environment without problems since i discovered this issue.
In the main process, i get some elements offset and length without troubleshooting but when i want to get content offset and lenght VDT throws me a IndexOutOfBoundsException.
Below the stack :
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 131782
at com.ximpleware.extended.XMLBuffer.byteAt(XMLBuffer.java:101)
at com.ximpleware.extended.VTDNavHuge.getCharUnit(VTDNavHuge.java:876)
at com.ximpleware.extended.VTDNavHuge.getOffsetAfterHead(VTDNavHuge.java:956)
at com.ximpleware.extended.VTDNavHuge.getContentFragment(VTDNavHuge.java:3955)
at fr.gouv.finances.dgfip.exomile.test.TestVTDIndexOutOfBoundException.main(TestVTDIndexOutOfBoundException.java:30)

I debug it and the issue seems to be in computing offset, i think VDT doesn't detect the closing tag and exceed the end of file... But i don't understand why i can get element offset and length without exception but not when i want to get inner content ? Maybe the problem relate to encoding...

I join to my message a java test file and XML data.
I try and reproduce this issue in 2.11 and 2.13.

Thanks

1 Attachments

Discussion

  • jimmy zhang

    jimmy zhang - 2016-10-26

    Thanks! will look into it and get back

     
  • jimmy zhang

    jimmy zhang - 2016-10-26
    • status: open --> pending
    • assigned_to: jimmy zhang
     
  • jimmy zhang

    jimmy zhang - 2016-10-28

    This bug is caused by an bug that was fixed in standard edition but not in the extended version... the bug is now fixed and you can download it by getting the latest VTDNavHuge.java.

     
  • jimmy zhang

    jimmy zhang - 2016-10-28
    • labels: --> fixed
    • status: pending --> closed
     
  • Rainette

    Rainette - 2016-11-02

    Are you sure this bug was fixed in extended version? I checkout sources and there is no modification since 6 months... I clone VTD XML repository at https://github.com/jzhang2004/vtd-xml.git. Is it right ?

     
    • jimmy zhang

      jimmy zhang - 2016-11-08

      Actually I am referencing to the CVS repo on sourceforge 

      http://vtd-xml.cvs.sourceforge.net/viewvc/vtd-xml/ximple-dev/com/ximpleware/extended/VTDNavHuge.java?view=log

      ----- Original Message -----
      From: "[vtd-xml:tickets] "
      To:"[vtd-xml:tickets]"
      Cc:
      Sent:Wed, 02 Nov 2016 16:54:25 +0000
      Subject:[vtd-xml:tickets] #8 ArrayIndexOutOfBoundsException with
      getContentFragment

      Are you sure this bug was fixed in extended version? I checkout
      

      sources and there is no modification since 6 months... I clone VTD XML
      repository at https://github.com/jzhang2004/vtd-xml.git. [1] Is it
      right ?


       [TICKETS:#8] [2] ARRAYINDEXOUTOFBOUNDSEXCEPTION WITH
      

      GETCONTENTFRAGMENT

      STATUS: closed
      

      MILESTONE: 1.0
      LABELS: fixed
      CREATED: Thu Oct 20, 2016 01:36 PM UTC by Rainette
      LAST UPDATED: Fri Oct 28, 2016 10:13 PM UTC
      OWNER: jimmy zhang
      ATTACHMENTS:

      * test.zip [3] (10.3 kB; application/x-zip-compressed)
      
      Hi,
      
      I'm using VDT XML in production environment without problems since i
      

      discovered this issue.
      In the main process, i get some elements offset and length without
      troubleshooting but when i want to get content offset and lenght VDT
      throws me a IndexOutOfBoundsException.
      Below the stack :
      Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException:
      131782
      at com.ximpleware.extended.XMLBuffer.byteAt(XMLBuffer.java:101)
      at
      com.ximpleware.extended.VTDNavHuge.getCharUnit(VTDNavHuge.java:876)
      at
      com.ximpleware.extended.VTDNavHuge.getOffsetAfterHead(VTDNavHuge.java:956)
      at
      com.ximpleware.extended.VTDNavHuge.getContentFragment(VTDNavHuge.java:3955)
      at
      fr.gouv.finances.dgfip.exomile.test.TestVTDIndexOutOfBoundException.main(TestVTDIndexOutOfBoundException.java:30)

      I debug it and the issue seems to be in computing offset, i think VDT
      

      doesn't detect the closing tag and exceed the end of file... But i
      don't understand why i can get element offset and length without
      exception but not when i want to get inner content ? Maybe the problem
      relate to encoding...

      I join to my message a java test file and XML data.
      

      I try and reproduce this issue in 2.11 and 2.13.

      Thanks
      

      Sent from sourceforge.net because you indicated interest in
      

      https://sourceforge.net/p/vtd-xml/tickets/8/ [4]

      To unsubscribe from further messages, please visit
      

      https://sourceforge.net/auth/subscriptions/ [5]

      [1] https://github.com/jzhang2004/vtd-xml.git.
      [2]
      http://sitemail.hostway.com/HTTPS://SOURCEFORGE.NET/P/VTD-XML/TICKETS/8/
      [3] https://sourceforge.net/p/vtd-xml/tickets/8/attachment/test.zip
      [4] https://sourceforge.net/p/vtd-xml/tickets/8/
      [5] https://sourceforge.net/auth/subscriptions/

       

Log in to post a comment.