WW-5589 Complete UIBean field encapsulation with private fields and public getters #1421
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.


Summary
This PR completes the comprehensive encapsulation of all UIBean fields by converting ALL remaining protected fields to private with public getter methods. This extends the fix from WW-5368 (PR #1420) to cover all protected fields in UIBean.
Closes WW-5589
Background
WW-5368 identified that OGNL triggers false-positive security warnings when resource bundle keys or expressions contain tokens matching protected UIBean field names (e.g., "label", "name", "value"). The root cause was OGNL attempting to access protected fields during expression evaluation before realizing they should be treated as string literals.
PR #1420 fixed the immediate issue by converting just the four most problematic fields (label, name, value, id) from protected to private with public getters. This PR extends that solution to ALL remaining protected fields for consistency and to prevent similar issues with other common field names like "key", "title", "disabled", "template", etc.
Changes
Core Changes to UIBean.java
Converted ALL remaining protected fields to private with public getters:
Template-related fields:
templateSuffix,template,templateDir,themeStyle/CSS fields:
cssClass,cssStyle,cssErrorClass,cssErrorStyleForm attribute fields:
key,disabled,tabindex,title,accesskeyLabel attribute fields:
labelPosition,labelSeparator,requiredPosition,errorPosition,requiredLabelEvent handler fields:
onclick,ondblclick,onmousedown,onmouseup,onmouseover,onmousemove,onmouseoutonfocus,onblur,onkeypress,onkeydown,onkeyup,onselect,onchangeTooltip fields (deprecated):
tooltip,tooltipConfig,javascriptTooltip,tooltipDelay,tooltipCssClass,tooltipIconPathOther:
dynamicAttributesMapAdded comprehensive public getter methods with JavaDoc for all fields.
Subclass Fixes
Updated UIBean subclasses to use getters instead of direct field access:
template→getTemplate()onchange→getOnchange()disabled→getDisabled(),title→getTitle()key→getKey(),template→getTemplate()key→getKey()key→getKey()Test Coverage
Added new test
testNoOgnlWarningsForAdditionalFields()in UIBeanTest that:Test Results
Benefits
Migration Impact
This is a binary-compatible change:
🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com