Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4479504

Duplicate definition in an example of NamespaceSupport usage

    Details

      Description



      Name: eaR10174 Date: 07/13/2001


        There is a Java error in the code sample in the description of the
      org.xml.sax.helpers.NamespaceSupport (builds jaxp-1.1.1-b26-09_jul_2001,
      jdk1.4.0beta-b70) - the variable 'parts' is defined three times:

          " ...
          
            String parts[] = new String[3];
              ^^^^^^^^^^^^^^ first definition of the variable 'parts'
              
            NamespaceSupport support = new NamespaceSupport();

            support.pushContext();
            support.declarePrefix("", "http://www.w3.org/1999/xhtml");
            support.declarePrefix("dc", "http://www.purl.org/dc#");

            String parts[] = support.processName("p", parts, false);
              ^^^^^^^^^^^^^^ second definition of the variable 'parts'
              
            System.out.println("Namespace URI: " + parts[0]);
            System.out.println("Local name: " + parts[1]);
            System.out.println("Raw name: " + parts[2]);

            String parts[] = support.processName("dc:title", parts, false);
              ^^^^^^^^^^^^^^ third definition of the variable 'parts'
            
            ..."

      ======================================================================

        Attachments

          Activity

            People

            • Assignee:
              egoei Edwin Goei (Inactive)
              Reporter:
              evgsunw Evg Evg (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: