From 543aadad208c012b9f1455b04e9b61c8abddcdfa Mon Sep 17 00:00:00 2001 From: jordillachmrf Date: Wed, 1 Aug 2018 16:27:40 +0200 Subject: [PATCH 1/2] #1274 Support EL in tag attributes Adding support to EL in tag attributes --- pmd-jsp/etc/grammar/JspParser.jjt | 2 +- .../sourceforge/pmd/lang/jsp/JspParserTest.java | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/pmd-jsp/etc/grammar/JspParser.jjt b/pmd-jsp/etc/grammar/JspParser.jjt index 7ea94dcf5f..44481522b2 100644 --- a/pmd-jsp/etc/grammar/JspParser.jjt +++ b/pmd-jsp/etc/grammar/JspParser.jjt @@ -248,7 +248,7 @@ PARSER_END(JspParser) TOKEN : { - > + | "${" ( | )* "}") > | " > : AfterTagState | " | "!>") > : AfterTagState | " > : AfterTagState diff --git a/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/JspParserTest.java b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/JspParserTest.java index b05018c207..cca6e33e08 100644 --- a/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/JspParserTest.java +++ b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/JspParserTest.java @@ -29,7 +29,21 @@ public class JspParserTest { "$129.00"); Assert.assertNotNull(node); } - + + @Test + public void testParseELAttribute() { + Node node = parse( + "
Div content here.
"); + Assert.assertNotNull(node); + } + + @Test + public void testParseELAttributeValue() { + Node node = parse( + "
Div content here.
"); + Assert.assertNotNull(node); + } + /** * Verifies bug #311 Jsp parser fails on boolean attribute */ From dcb9d4ade1a71eb76880d74bb202352897a350de Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Mon, 6 Aug 2018 09:40:04 +0200 Subject: [PATCH 2/2] Update release notes, closes #1274 --- 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 8775473a77..d6b7e1cebb 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -40,6 +40,8 @@ This is a minor release. * [#1216](https://github.com/pmd/pmd/issues/1216): \[java] UnnecessaryFullyQualifiedName false positive for the same name method * java-design * [#1217](https://github.com/pmd/pmd/issues/1217): \[java] CyclomaticComplexityRule counts ?-operator twice +* jsp + * [#1274](https://github.com/pmd/pmd/issues/1274): \[jsp] Support EL in tag attributes * plsql * [#980](https://github.com/pmd/pmd/issues/980): \[plsql] ParseException for CREATE TABLE * [#981](https://github.com/pmd/pmd/issues/981): \[plsql] ParseException when parsing VIEW @@ -57,3 +59,4 @@ This is a minor release. * [#1182](https://github.com/pmd/pmd/pull/1182): \[ui] XPath AutoComplete - [Akshat Bahety](https://github.com/akshatbahety) * [#1231](https://github.com/pmd/pmd/pull/1231): \[doc] Minor typo fix in installation.md - [Ashish Rana](https://github.com/ashishrana160796) * [#1250](https://github.com/pmd/pmd/pull/1250): \[ci] \[GSoC] Upload baseline of pmdtester automatically - [BBG](https://github.com/djydewang) +* [#1275](https://github.com/pmd/pmd/pull/1275): \[jsp] Issue #1274 - Support EL in tag attributes - [Jordi Llach](https://github.com/jordillachmrf)