You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by "gdesrosiers1805 (via GitHub)" <gi...@apache.org> on 2026/06/05 20:37:19 UTC
[PR] Replace deprecated URL constructor in XercesValidator [daffodil]
gdesrosiers1805 opened a new pull request, #1678:
URL: https://github.com/apache/daffodil/pull/1678
java.net.URL(String) has been deprecated since JDK 20, and causes the build to fail in some instances. Use the new URI(schemaFile).toURL instead, which is non-deprecated and available on all supported JDK versions.
DAFFODIL-3083
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Replace deprecated URL constructor in XercesValidator [daffodil]
Posted by "stevedlawrence (via GitHub)" <gi...@apache.org>.
stevedlawrence commented on code in PR #1678:
URL: https://github.com/apache/daffodil/pull/1678#discussion_r3372872906
##########
daffodil-core/src/main/scala/org/apache/daffodil/validation/XercesValidator.scala:
##########
@@ -60,7 +61,7 @@ object XercesValidatorFactory {
"invalid configuration: xerces property is empty or not defined"
)
}
- val url = new URL(schemaFile)
+ val url = new URI(schemaFile).toURL
Review Comment:
We also use the URL constructors in these files:
```
daffodil-core/src/main/java/org/apache/daffodil/api/validation/package-info.java: * dataProcessor.withValidation("xerces", new URL("file:///path/to/schema.xsd"))
daffodil-core/src/main/java/org/apache/daffodil/api/validation/package-info.java: * dataProcessor.withValidation("schematron", new URL("file:///path/to/schematron.sch"))
daffodil-core/src/main/java/org/apache/daffodil/api/validation/package-info.java: * dataProcessor.withValidation("schematron", new URL("file:///path/to/schematron.properties"))
daffodil-schematron/src/main/scala/org/apache/daffodil/validation/schematron/SchematronValidatorFactory.scala: val schUrl = new URL({
daffodil-test/src/test/scala/org/apache/daffodil/infoset/TestStringAsXmlValidator.scala: private lazy val xercesValidator = XercesValidator.fromURL(new URL(schemaURL))
```
Can you fix those too, including the ones in javadocs since they could be used as examples?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Replace deprecated URL constructor globally [daffodil]
Posted by "stevedlawrence (via GitHub)" <gi...@apache.org>.
stevedlawrence merged PR #1678:
URL: https://github.com/apache/daffodil/pull/1678
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org