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

FEATURE_SECURE_PROCESSING can not be turned off on a validator through SchemaFactory

    Details

      Backports

        Description

        The setFeature method of SchemaFactory is specified as the following:
         "Set a feature for this SchemaFactory, Schemas created by this factory, and by extension, Validators and ValidatorHandlers created by those Schemas.
           
        Implementors and developers should pay particular attention to how the special Schema object returned by newSchema() is processed. In some cases, for example, when the SchemaFactory and the class actually loading the schema come from different implementations, it may not be possible for SchemaFactory features to be inherited automatically. Developers should make sure that features, such as secure processing, are explicitly set in both places."
         
        But run the following code snippet on JDK 9, it outputs true
        ---------------------------------------------
                SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
                 schemaFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, false);
                 Schema schema = schemaFactory.newSchema(xsdSource);
                Validator validator = schema.newValidator();
                System.out.println( validator.getFeature(XMLConstants.FEATURE_SECURE_PROCESSING));
         ----------------------------------------------

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  joehw Joe Wang
                  Reporter:
                  fyuan Frank Yuan
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  5 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: