Bug 285289 - [xpath2] fn:substring throwing StringOutofBounds Exceptions
Summary: [xpath2] fn:substring throwing StringOutofBounds Exceptions
Status: RESOLVED FIXED
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: wst.xpath (show other bugs)
Version: unspecified   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 3.2 M1   Edit
Assignee: David Carver CLA
QA Contact: David Carver CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 262765
  Show dependency tree
 
Reported: 2009-07-31 10:36 EDT by David Carver CLA
Modified: 2010-08-11 17:08 EDT (History)
0 users

See Also:


Attachments
Fix for Substring failures (4.16 KB, patch)
2009-07-31 11:59 EDT, David Carver CLA
no flags Details | Diff
mylyn/context/zip (73.92 KB, application/octet-stream)
2009-07-31 11:59 EDT, David Carver CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Carver CLA 2009-07-31 10:36:28 EDT
fn:substring can accept both negative and postive values for starting position and ending position.  The current code is not taking into account the adjustments that are needed in positioning.
Comment 1 David Carver CLA 2009-07-31 11:59:25 EDT
Created attachment 143154 [details]
Fix for Substring failures

This fixes the substring failures and also refactors the code for easier readability.  The main substring function was doing too much stuff.
Comment 2 David Carver CLA 2009-07-31 11:59:28 EDT
Created attachment 143155 [details]
mylyn/context/zip
Comment 3 David Carver CLA 2009-07-31 12:03:22 EDT
patch checked into head, and tests pass.