Project

Profile

Help

Bug #5375

closed

ArrayIndexOutOfBoundsException in NamespaceMap

Added by Taras Chervinka over 2 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Internals
Sprint/Milestone:
-
Start date:
2022-03-08
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
10, 11, trunk
Fix Committed on Branch:
10, 11, trunk
Fixed in Maintenance Release:
Platforms:
.NET, Java

Description

net.sf.saxon.om.NamespaceMap#getDifferences throws ArrayIndexOutOfBoundsException

variables seen in debug:

this = {NamespaceMap@39060} Object is being initialized
 prefixes = {String[2]@39064} ["abp", "wsp"]
 uris = {String[2]@39063} ["http://schemas....", "http://schemas...."]
other = {NamespaceMap@39061} "wsa=http://www.w3.org/2005/08/addressing "
 prefixes = {String[1]@39065} ["wsa"]
  0 = {String@39044} "wsa"
 uris = {String[1]@39067} ["http://www.w3.o..."]
addUndeclarations = false

The class fails at this IF statement as i=1 while there is only one element in array

else {
               if (addUndeclarations || other.prefixes[i].isEmpty()) {
                  result.add(new NamespaceBinding(other.prefixes[j], ""));
               }

               ++j;
            }

also I see that 10.5, 10.6 had this.prefixes[i] in the same IF statement:

else {
               if (addUndeclarations || this.prefixes[i].isEmpty()) {
                  result.add(new NamespaceBinding(other.prefixes[j], ""));
               }

               ++j;
            }

Please register to edit this issue

Also available in: Atom PDF