Ostrzyciel opened a new pull request, #2906:
URL: https://github.com/apache/jena/pull/2906

   GitHub issue resolved #2828 
   
   Pull request Description:
   
   This completes #2828, removing the vast majority of unused and unnecessary 
code in the ext.xerces namespace. Jena still compiles after this, and tests 
seem to be passing.
   
   - In general, I went through the code iteratively, locating unreachable code 
branches and unused fields/methods/classes. I repeated this until there was 
nothing left to remove.
   - The `ValidationState` class that I initially had my main issue with turned 
out to be completely unnecessary. As far as I understand, its only use was to 
store some state as the validator goes through the XML document. Because here 
we are always validating one literal (and not a document), this was not needed 
at all.
   - After #2833, the only use of the `pattern` facet (for regex checks) was 
for `xsd:language`, where the pattern is very, very simple 
(`([a-zA-Z]{1,8})(-[a-zA-Z0-9]{1,8})*`). I have therefore removed the xerces 
regex implementation from core entirely and instead the code now uses Java 
`Pattern`. I'm 99.9% sure it will be fine. I've also added some tests to check 
this.
   - Several other validation facets turned out to be unused in the code (for 
example: everything related to length). I have removed these.
   - Many classes were used only for validation of custom XSD types, and 
therefore they were removed.
   - The size of the `jena-core` JAR was reduced by ~165 KB (from 2_016_067 to 
1_846_347 bytes).
   - Datatype validation in Jena should be somewhat sped up by this, just 
because less objects are allocated and passed through the call stack. The 
leaner code size may also help with instruction caching on the CPU. I didn't do 
any benchmarks, though... I will check this and come back later with some 
numbers.
   
   ----
   
    - [x] Tests are included.
    - [x] Documentation change and updates are provided for the [Apache Jena 
website](https://github.com/apache/jena-site/)
    - [x] Commits have been squashed to remove intermediate development commit 
messages.
    - [x] Key commit messages start with the issue number (GH-xxxx)
   
   By submitting this pull request, I acknowledge that I am making a 
contribution to the Apache Software Foundation under the terms and conditions 
of the [Contributor's 
Agreement](https://www.apache.org/licenses/contributor-agreements.html).
   
   ----
   
   See the [Apache Jena "Contributing" 
guide](https://github.com/apache/jena/blob/main/CONTRIBUTING.md).
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to