From 4f58cc695cd94c307de0aa9008d81192c81cda7d Mon Sep 17 00:00:00 2001 From: "artem.krosheninnikov" Date: Fri, 14 Jun 2019 18:03:51 +0300 Subject: [PATCH 1/4] fix #1666 wrong cdata rule description and examples --- pmd-xml/src/main/resources/category/xml/errorprone.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pmd-xml/src/main/resources/category/xml/errorprone.xml b/pmd-xml/src/main/resources/category/xml/errorprone.xml index 18c01924d6..c868b036f0 100644 --- a/pmd-xml/src/main/resources/category/xml/errorprone.xml +++ b/pmd-xml/src/main/resources/category/xml/errorprone.xml @@ -12,11 +12,11 @@ Rules to detect constructs that are either broken, extremely confusing or prone -An XML CDATA section begins with a <!CDATA[ marker, which has only one [, and ends with a ]]> marker, which has only two ]. +An XML CDATA section begins with a <![CDATA[ marker, which has only one [, and ends with a ]]> marker, which has two ]. 3 @@ -30,7 +30,7 @@ An XML CDATA section begins with a <!CDATA[ marker, which has only one [, and From 75d40e741d8858e999c187eae925cd6ab81aa312 Mon Sep 17 00:00:00 2001 From: "artem.krosheninnikov" Date: Fri, 14 Jun 2019 23:51:41 +0300 Subject: [PATCH 2/4] fixed output typo --- pmd-xml/src/test/java/net/sourceforge/pmd/ant/PMDTaskTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pmd-xml/src/test/java/net/sourceforge/pmd/ant/PMDTaskTest.java b/pmd-xml/src/test/java/net/sourceforge/pmd/ant/PMDTaskTest.java index 6d560cc89c..15955b0565 100644 --- a/pmd-xml/src/test/java/net/sourceforge/pmd/ant/PMDTaskTest.java +++ b/pmd-xml/src/test/java/net/sourceforge/pmd/ant/PMDTaskTest.java @@ -15,6 +15,6 @@ public class PMDTaskTest extends AbstractAntTestHelper { @Test public void testXML() { executeTarget("testXML"); - assertOutputContaining("Potentialy mistyped CDATA section with extra [ at beginning or ] at the end."); + assertOutputContaining("Potentially mistyped CDATA section with extra [ at beginning or ] at the end."); } } From 084c78a5ea4ee3780f63d696de4ae7226a604d42 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Sat, 13 Jul 2019 19:39:41 +0200 Subject: [PATCH 3/4] [xml] Improve example for MistypedCDATASection --- .../resources/category/xml/errorprone.xml | 13 +++++++- .../errorprone/xml/MistypedCDATASection.xml | 30 +++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/pmd-xml/src/main/resources/category/xml/errorprone.xml b/pmd-xml/src/main/resources/category/xml/errorprone.xml index c868b036f0..46f598d8e4 100644 --- a/pmd-xml/src/main/resources/category/xml/errorprone.xml +++ b/pmd-xml/src/main/resources/category/xml/errorprone.xml @@ -30,7 +30,18 @@ An XML CDATA section begins with a <![CDATA[ marker, which has only one [, an + + - this cdata section is valid, but it contains an + additional square bracket at the beginning. + It should probably be just . + + + - this cdata section is valid, but it contains an + additional square bracket in the end. + It should probably be just . + + ]]> diff --git a/pmd-xml/src/test/resources/net/sourceforge/pmd/lang/xml/rule/errorprone/xml/MistypedCDATASection.xml b/pmd-xml/src/test/resources/net/sourceforge/pmd/lang/xml/rule/errorprone/xml/MistypedCDATASection.xml index 45388522ab..c748e2e5e4 100644 --- a/pmd-xml/src/test/resources/net/sourceforge/pmd/lang/xml/rule/errorprone/xml/MistypedCDATASection.xml +++ b/pmd-xml/src/test/resources/net/sourceforge/pmd/lang/xml/rule/errorprone/xml/MistypedCDATASection.xml @@ -70,4 +70,34 @@ ]]> xml + + Example code + 2 + 3,8 + + + - this cdata section is valid, but it contains an + additional square bracket in the end. + It should probably be just . + + + - this cdata section is valid, but it contains an + additional square bracket at the beginning. + It should probably be just . + + + ]]> + + + Square bracket at end separate by space is ok + 0 + + + + + + ]]> + From 70c66c29524b291487e8ad1d41c039238199be1d Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Sat, 13 Jul 2019 19:41:53 +0200 Subject: [PATCH 4/4] Update release notes, fixes #1666, refs #1869 --- docs/pages/release_notes.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index f78c2baa10..0839fda19f 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -54,6 +54,8 @@ datetime field. * plsql * [#1828](https://github.com/pmd/pmd/issues/1828): \[plsql] Parentheses stopped working * [#1850](https://github.com/pmd/pmd/issues/1850): \[plsql] Parsing errors with INSERT using returning or records and TRIM expression +* xml + * [#1666](https://github.com/pmd/pmd/issues/1666): \[xml] wrong cdata rule description and examples ### API Changes @@ -90,6 +92,7 @@ of deprecations. * [#1863](https://github.com/pmd/pmd/pull/1863): \[plsql] Add Table InlineConstraint - [kabroxiko](https://github.com/kabroxiko) * [#1864](https://github.com/pmd/pmd/pull/1864): \[plsql] Add support for Subquery Views - [kabroxiko](https://github.com/kabroxiko) * [#1865](https://github.com/pmd/pmd/pull/1865): \[plsql] Add Support for Extract Expression - [kabroxiko](https://github.com/kabroxiko) +* [#1869](https://github.com/pmd/pmd/pull/1869): \[xml] fix #1666 wrong cdata rule description and examples - [Artem](https://github.com/KroArtem) {% endtocmaker %}