Skip to content

Conversation

@JoeWang-Java
Copy link
Member

@JoeWang-Java JoeWang-Java commented Mar 13, 2025

Add public identifiers to the JDK built-in Catalog; Replace the incorrect Schema 1.1 DTD files (note the Public Identifier at line 2) with the correct Schema 1.0 DTDs. The JDK built-in Catalog contains Schema 1.0 files only.

DTD files: the Schema 1.1 files, XMLSchema.dtd and datatypes.dtd, were removed and replaced with those of Schema 1.0. These files were downloaded from w3.org without modification. The file names were unfortunately the same, which (with the Diffs) made it look like they were modified though they were not.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8351969: Add Public Identifiers to the JDK built-in Catalog (Bug - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/24039/head:pull/24039
$ git checkout pull/24039

Update a local copy of the PR:
$ git checkout pull/24039
$ git pull https://git.openjdk.org/jdk.git pull/24039/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 24039

View PR using the GUI difftool:
$ git pr show -t 24039

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/24039.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 13, 2025

👋 Welcome back joehw! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Mar 13, 2025

@JoeWang-Java This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8351969: Add Public Identifiers to the JDK built-in Catalog

Reviewed-by: rriggs, lancea, iris, naoto

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 59 new commits pushed to the master branch:

  • fed34e4: 8351933: Inaccurate masking of TC subfield decrement in ForkJoinPool
  • 8f64ccc: 8350485: C2: factor out common code in Node::grow() and Node::out_grow()
  • c2be19c: 8351902: RISC-V: Several tests fail after JDK-8351145
  • e57b272: 8350578: Refactor useless Parse and Template Assertion Predicate elimination code by using a PredicateVisitor
  • 577ede7: 8352302: Test sun/security/tools/jarsigner/TimestampCheck.java is failing
  • 20d4fe3: 8351464: Shenandoah: Hang on ShenandoahController::handle_alloc_failure when run test TestAllocHumongousFragment#generational
  • 8e53063: 8352275: Clean up dead code in jpackage revealed with improved negative test coverage
  • c8a11f2: 8352293: jpackage tests build rpm packages on Ubuntu test machines after JDK-8351372
  • 4a02de8: 8352098: -Xrunjdwp fails on static JDK
  • 355b2f3: 8351374: Improve comment about queue.remove timeout in CleanerImpl.run
  • ... and 49 more: https://git.openjdk.org/jdk/compare/771e160da4daa98bfe37bf1acba65454c088910c...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the rfr Pull request is ready for review label Mar 13, 2025
@openjdk
Copy link

openjdk bot commented Mar 13, 2025

@JoeWang-Java The following label will be automatically applied to this pull request:

  • core-libs

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the core-libs core-libs-dev@openjdk.org label Mar 13, 2025
@mlbridge
Copy link

mlbridge bot commented Mar 13, 2025

Webrevs

Copy link
Member

@myankelev myankelev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, just a few very minor questions. Thank you

public void setUpClass() throws Exception {
// initialize JDKCatalog
JdkCatalog.init("continue");
jdkCatalog = JdkCatalog.catalog;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be a set up just for 1 test. Do you think it might be better to have this logic in the beginning of the testDTDsInJDKCatalog?

static final String TARGET_NAMESPACE = "{{targetNamespace}}";
static final String ROOT_ELEMENT = "{{rootElement}}";

Catalog jdkCatalog;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: if this will stay as a global var I'd personally make it private and move to the top of the file. What do you think?

* @test
* @bug 8344800 8345353
* @bug 8344800 8345353 8351969
* @modules java.xml/jdk.xml.internal
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know that this is not a part of your change, but this (line 56) doesn't seem to be used at all. Could you please remove it if there will be another revision? If not it's ok as is 😄
static String CLS_DIR = System.getProperty("test.classes");

*/
@Test(dataProvider = "DTDsInJDKCatalog")
public void testDTDsInJDKCatalog(String publicId, String systemId)
throws Exception {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Don't think throw exception is doing anything here.

* Data provided: public and system Ids, see test testDTDsInJDKCatalog
*/
@DataProvider(name = "DTDsInJDKCatalog")
public Object[][] getDTDsInJDKCatalog() throws Exception {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Don't think throw exception is doing anything here.

@JoeWang-Java
Copy link
Member Author

Thanks for review. Updated the test.

@myankelev
Copy link
Member

Thanks for review. Updated the test.

Thank you!

Copy link
Contributor

@LanceAndersen LanceAndersen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes look OK Joe

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Mar 18, 2025
Copy link
Contributor

@RogerRiggs RogerRiggs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The XMLSchema.dtd changes the referenced version from the 2009 version to the 2001 version. Is that intentional.

Comment on lines +4 to +8
<!-- $Id: XMLSchema.dtd,v 1.31 2001/10/24 15:50:16 ht Exp $ -->
<!-- Note this DTD is NOT normative, or even definitive. --> <!--d-->
<!-- prose copy in the structures REC is the definitive version --> <!--d-->
<!-- (which shouldn't differ from this one except for this --> <!--d-->
<!-- comment and entity expansions, but just in case) --> <!--d-->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other XML comments use the multi-line format with a single begin
What is the meaning of ""?
Is "REC" a typo?
The comment seems unnecessarily apologetic. It should be sufficient to say:
Note: this DTD is NOT normative, any differences from RFC XXX are insidential". (or similar).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. The question would be, would we want to modify the standard file?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likely, a number of my comments were due to comparing with the wrong XMLSchema.data version.

<!ENTITY % xs-datatypes PUBLIC 'datatypes' 'datatypes.dtd' >

<!ENTITY % p 'xs:'> <!-- can be overridden in the internal subset of a
<!ENTITY % p 'xs:'> <!-- can be overriden in the internal subset of a
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original version is correct "overridden".

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typos in the original should be retained to avoid gratuitous difference.

*/
package common.jdkcatalog;

import static jaxp.library.JAXPTestUtilities.SRC_DIR;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Static imports across classes (even with a package) make it harder to read the test and know where it is imported from. The reference in the source here should include the class its imported from.

Comment on lines 142 to 143
String matchingPubId = JDKCATALOG.matchPublic(publicId);
String matchingSysId = JDKCATALOG.matchSystem(systemId);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't there a public API to get these values. It seems a bit of a hack to have to break module encapsulation.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated. Thanks!

@JoeWang-Java
Copy link
Member Author

The XMLSchema.dtd changes the referenced version from the 2009 version to the 2001 version. Is that intentional.

Yes. Note the Public Identifier: "-//W3C//DTD XSD 1.1//EN" vs "-//W3C//DTD XMLSCHEMA 200102//EN" at line 2. The 2009 version was for Schema 1.1 while the 2001 version for Schema 1.0. As shown in the JDKCatalog.xml, only Schema 1.0 is included in the catalog. It's a bit unfortunate the files were named the same.

The 1.1 version file was indeed better formatted/worded. But since this is standard file, it was a simple copy without modification.

@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Mar 19, 2025
Copy link
Contributor

@RogerRiggs RogerRiggs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The .dtds look fine.
Thanks for the update to the test.

<!ENTITY % xs-datatypes PUBLIC 'datatypes' 'datatypes.dtd' >

<!ENTITY % p 'xs:'> <!-- can be overridden in the internal subset of a
<!ENTITY % p 'xs:'> <!-- can be overriden in the internal subset of a
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typos in the original should be retained to avoid gratuitous difference.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Mar 19, 2025
@JoeWang-Java
Copy link
Member Author

Thanks all for the reviews!

@JoeWang-Java
Copy link
Member Author

/integrate

@openjdk
Copy link

openjdk bot commented Mar 19, 2025

Going to push as commit 8e999b8.
Since your change was applied there have been 60 commits pushed to the master branch:

  • c7f3338: 8352109: java/awt/Desktop/MailTest.java fails in platforms where Action.MAIL is not supported
  • fed34e4: 8351933: Inaccurate masking of TC subfield decrement in ForkJoinPool
  • 8f64ccc: 8350485: C2: factor out common code in Node::grow() and Node::out_grow()
  • c2be19c: 8351902: RISC-V: Several tests fail after JDK-8351145
  • e57b272: 8350578: Refactor useless Parse and Template Assertion Predicate elimination code by using a PredicateVisitor
  • 577ede7: 8352302: Test sun/security/tools/jarsigner/TimestampCheck.java is failing
  • 20d4fe3: 8351464: Shenandoah: Hang on ShenandoahController::handle_alloc_failure when run test TestAllocHumongousFragment#generational
  • 8e53063: 8352275: Clean up dead code in jpackage revealed with improved negative test coverage
  • c8a11f2: 8352293: jpackage tests build rpm packages on Ubuntu test machines after JDK-8351372
  • 4a02de8: 8352098: -Xrunjdwp fails on static JDK
  • ... and 50 more: https://git.openjdk.org/jdk/compare/771e160da4daa98bfe37bf1acba65454c088910c...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Mar 19, 2025
@openjdk openjdk bot closed this Mar 19, 2025
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Mar 19, 2025
@openjdk
Copy link

openjdk bot commented Mar 19, 2025

@JoeWang-Java Pushed as commit 8e999b8.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@JoeWang-Java JoeWang-Java deleted the JDK-8351969 branch March 31, 2025 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core-libs core-libs-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

6 participants