[jsp] NoClassAttribute rule is generating a false positive
#2 033 ouverte le 27 sept. 2019
Métriques du dépôt
- Stars
- (4 544 étoiles)
- Métriques de merge PR
- (Merge moyen 3j 19h) (78 PRs mergées en 30 j)
Description
Affects PMD Version: 6.18.0+ 7.0.0
Rule: NoClassAttribute
Description: The rule generates an error for a jsp:usebean tag whose "class" is specified.
Code Sample demonstrating the issue: In JSP page:
<jsp:usebean id="data" class="jdbc.JdbcBean"/>
Running PMD through: Any.
The rule needs the ability to exclude the above JSP tag.
The other option is to suppress this false-positive violation. Suppressing via the message generated by PMD is not possible currently since the message does not list the offending tag. PMD doesn't compile the JSP files into java source. (Does PMD intend to go down that route?) Suppressing via Xpath isn't possible either.
Is it possible that PMD can generate ASTs for JSPs as well in the future?
The rule could be modified to ignore the above tag with a default property value which is extensible to user-specified tags if necessary.
Suppressions won't be needed in that case.