You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[jsp] Fix #2033: NoClassAttribute for jsp:useBean - #6906
NoClassAttribute currently reports the class attribute required by jsp:useBean. This narrows the XPath exception to that element only, using case-insensitive matching, and documents the exception. The regression fixture covers both the conventional jsp:useBean spelling and the lowercase spelling from the report while retaining the existing positive case.
Thanks for the question. The linked issue specifically reports a false positive for <jsp:useBean> (including the lowercase spelling), so this PR intentionally whitelists only that standard action and keeps the change narrowly scoped to #2033. I don't see evidence in the issue that other tags need the same exception. A configurable allowlist could be useful for additional tag-specific cases, but that would expand the rule's configuration surface beyond the reported regression; I'd prefer to handle it in a follow-up unless you'd like this PR to take that direction.
Compared to main:
This changeset changes 0 violations,
introduces 0 new violations, 0 new errors and 0 new configuration errors,
removes 0 violations, 0 errors and 0 configuration errors.
There are 0 changed duplications, 0 new duplications and 0 removed duplications.
There are 0 changed CPD errors, 0 new CPD errors and 0 removed CPD errors.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe the PR
NoClassAttributecurrently reports theclassattribute required byjsp:useBean. This narrows the XPath exception to that element only, using case-insensitive matching, and documents the exception. The regression fixture covers both the conventionaljsp:useBeanspelling and the lowercase spelling from the report while retaining the existing positive case.Related issues
Ready?
./mvnw clean verifypassesValidation
./mvnw -pl pmd-jsp -Dtest=NoClassAttributeTest test(3 tests)./mvnw clean verify -pl pmd-jsp -amAssisted by OpenAI Codex. The change was independently reviewed; the review-driven casing and rule-description improvements are included.