Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix:Spring fails to determine XML is XSD-based if DOCTYPE appears in a comment #27927

Closed
wants to merge 2 commits into from

Conversation

shooye
Copy link

@shooye shooye commented Jan 12, 2022

It solves the problem that XmlValidationModeDetector cannot determine whether XML is based on XSD due to improper parsing of comments spanning multiple lines in the original XML configuration file.

Fixes #27915

fix:Spring fails to determine XML is XSD-based if DOCTYPE appears in a comment
@pivotal-cla
Copy link

@shooye Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jan 12, 2022
@pivotal-cla
Copy link

@shooye Thank you for signing the Contributor License Agreement!

@sbrannen sbrannen added in: core Issues in core modules (aop, beans, core, context, expression) type: bug A general bug labels Jan 12, 2022
Thank Sam Brannen give me advice:

> I noticed that you introduced a second boolean flag to track whether we're "in a comment", and I thought we would still only need a single flag for that.

I have removed the second Boolean flag, Use only a Boolean said to track whether we're "in a comment".

Also, this method also passed all tests.
@sbrannen
Copy link
Member

Hi @shooye,

We really appreciate all the effort you put in to provide a fix!

In the end, we decided to go with a simpler solution that relies on recursion in order to reuse the existing comment parsing logic. If you're interested in checking it out, you'll find it in 4b1b254#diff-d2b71d5dbef74357add917ba7662a8f3d376fe9e965f82cd08407587b55bf833.

In light of that, I am closing this PR.

Thanks again for reporting this set of bugs.

@sbrannen sbrannen closed this Jan 13, 2022
@sbrannen sbrannen added status: declined A suggestion or change that we don't feel we should currently apply status: superseded An issue that has been superseded by another and removed status: waiting-for-triage An issue we've not yet triaged or decided on status: declined A suggestion or change that we don't feel we should currently apply labels Jan 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: superseded An issue that has been superseded by another type: bug A general bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Spring fails to determine XML is XSD-based if DOCTYPE appears in a comment
4 participants