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

Debug messages being printed when calling SAXParser.reset()

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 5.0u1
    • Fix Version/s: 5.0u2
    • Component/s: xml
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b04
    • CPU:
      x86
    • OS:
      windows_xp
    • Verification:
      Verified

      Description

      Debug messages are being printed.
      Remvoing feature = http://java.sun.com/xml/jaxp/properties/schemaLanaguage

      JUnit test case to reproduce the problem

      import javax.xml.parsers.SAXParser;
      import javax.xml.parsers.SAXParserFactory;
      import junit.textui.TestRunner;
      import junit.framework.TestCase;

      /**
       *
       * @author Neeraj Bajaj, Sun Microsystems.
       *
       */
      public class Test extends TestCase{
          

          static final String W3C_XML_SCHEMA = "http://www.w3.org/2001/XMLSchema";
          static final String JAXP_SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
          static final String JAXP_SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
          
          /** Creates a new instance of Test */
          public Test(String name) {
              super(name);
          }
        
          public void test1() throws Exception{
              boolean passed = true;
              try{
                  SAXParserFactory spfactory = SAXParserFactory.newInstance();
                  //System.out.println("spfactory = " + spfactory);
                  spfactory.setNamespaceAware(true);
                  spfactory.setValidating(true);
                  SAXParser sp = spfactory.newSAXParser();

                  sp.setProperty(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
                  sp.setProperty(JAXP_SCHEMA_SOURCE, "./anyValue");
                  //System.out.println("Before Reset");

                  sp.reset();

                  //this shouldn't have any effect on the parser instance previously created.
                  spfactory.setNamespaceAware(false);
                  spfactory.setValidating(false);

                  //System.out.println("After Reset");
                  sp.setProperty(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
                  sp.setProperty(JAXP_SCHEMA_SOURCE, "./anyValue");


                  String propertyName = (String)sp.getProperty(JAXP_SCHEMA_LANGUAGE);
                  
              }catch(Exception ex){
                  ex.printStackTrace();
                  passed = false;
              }
              assertTrue(passed);
          }
          
          /**
           * @param args the command line arguments
           */
          public static void main(String[] args) {
              TestRunner.run(Test.class);
          }
          
      }

      ###@###.### 2004-11-17 09:40:42 GMT

        Attachments

          Activity

            People

            Assignee:
            nbajajsunw Neeraj Bajaj (Inactive)
            Reporter:
            nbajajsunw Neeraj Bajaj (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: