You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by "Michael Glavassevich (JIRA)" <xe...@xml.apache.org> on 2007/11/06 23:01:21 UTC

[jira] Issue Comment Edited: (XERCESJ-1279) ClassCastException in SubstitutionGroupHandler.addSubstitutionGroup() during Document.normalize()

    [ https://issues.apache.org/jira/browse/XERCESJ-1279?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12540590 ] 

mrglavas@ca.ibm.com edited comment on XERCESJ-1279 at 11/6/07 2:00 PM:
------------------------------------------------------------------------

(I vaguely remember someone reporting a bug similar to this one ages ago. I thought it was fixed.)

It would be very helpful if you provided a test case. Can you attach a schema and instance document which reproduces this problem? Thanks.

      was (Author: mrglavas@ca.ibm.com):
    (I vaguely remember someone reporting a bug similar to this one ages ago. I thought it was fixed.)

It would be very helpful you provided a test case. Can you attach a schema and instance document which reproduces this problem? Thanks.
  
> ClassCastException in SubstitutionGroupHandler.addSubstitutionGroup() during Document.normalize()
> -------------------------------------------------------------------------------------------------
>
>                 Key: XERCESJ-1279
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1279
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: DOM (Level 3 Core)
>    Affects Versions: 2.9.1
>         Environment: Windows, Sun JRE 1.6.00_03
>            Reporter: Bill Michell
>
> Change 319073 introduced the class SubstitutionGroupHandler$OneSubGroup and the Hashtable fSubGroupB
> According to the documentation, the field has the following characteristics:
>     // to store substitution group information
>     // the key to the hashtable is an element decl, and the value is
>     // - a Vector, which contains all elements that has this element as their
>     //   substitution group affilication
>     // - an array of OneSubGroup, which contains its substitution group before block.
> Unfortuntately, addSubstitutionGroup() contains the following line:
>             subGroup = (Vector)fSubGroupsB.get(subHead);
> This fails with a ClassCastException if the value for the key passed turns out to be a OneSubGroup[]
> The following lines of getSubGroupB() appear to ensure that a OneSubGroup[] is in the map:
>         // Convert to an array
>         OneSubGroup[] ret = new OneSubGroup[newGroup.size()];
>         for (int i = newGroup.size()-1; i >= 0; i--) {
>             ret[i] = (OneSubGroup)newGroup.elementAt(i);
>         }
>         // Store the potential sub group
>         fSubGroupsB.put(element, ret);
>         
>  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org