This is an automated email from the ASF dual-hosted git repository. lukaszlenart pushed a commit to branch fix/WW-5529-maxlength-s7 in repository https://gitbox.apache.org/repos/asf/struts.git
commit e681b1a2a5876358bc81450f6fc1e6c5ddaf0031 Author: Lukasz Lenart <lukaszlen...@apache.org> AuthorDate: Mon Feb 17 09:03:07 2025 +0100 WW-5529 Drops unused misleading setter setMaxLength in favour of setMaxlength --- .../org/apache/struts2/components/TextField.java | 27 ++++++++-------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/core/src/main/java/org/apache/struts2/components/TextField.java b/core/src/main/java/org/apache/struts2/components/TextField.java index 90f50e519..726c4fc5b 100644 --- a/core/src/main/java/org/apache/struts2/components/TextField.java +++ b/core/src/main/java/org/apache/struts2/components/TextField.java @@ -18,13 +18,12 @@ */ package org.apache.struts2.components; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.apache.struts2.util.ValueStack; import org.apache.struts2.views.annotations.StrutsTag; import org.apache.struts2.views.annotations.StrutsTagAttribute; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - /** * <!-- START SNIPPET: javadoc --> * <p>Render an HTML input field of type text</p> @@ -50,17 +49,16 @@ import jakarta.servlet.http.HttpServletResponse; * </pre> */ @StrutsTag( - name="textfield", - tldTagClass="org.apache.struts2.views.jsp.ui.TextFieldTag", - description="Render an HTML input field of type text", - allowDynamicAttributes=true) + name = "textfield", + tldTagClass = "org.apache.struts2.views.jsp.ui.TextFieldTag", + description = "Render an HTML input field of type text", + allowDynamicAttributes = true) public class TextField extends UIBean { /** * The name of the default template for the TextFieldTag */ final public static String TEMPLATE = "text"; - protected String maxlength; protected String readonly; protected String size; @@ -95,27 +93,22 @@ public class TextField extends UIBean { } - @StrutsTagAttribute(description="HTML maxlength attribute", type="Integer") + @StrutsTagAttribute(description = "HTML maxlength attribute", type = "Integer") public void setMaxlength(String maxlength) { this.maxlength = maxlength; } - @StrutsTagAttribute(description="Deprecated. Use maxlength instead.", type="Integer") - public void setMaxLength(String maxlength) { - this.maxlength = maxlength; - } - - @StrutsTagAttribute(description="Whether the input is readonly", type="Boolean", defaultValue="false") + @StrutsTagAttribute(description = "Whether the input is readonly", type = "Boolean", defaultValue = "false") public void setReadonly(String readonly) { this.readonly = readonly; } - @StrutsTagAttribute(description="HTML size attribute", type="Integer") + @StrutsTagAttribute(description = "HTML size attribute", type = "Integer") public void setSize(String size) { this.size = size; } - @StrutsTagAttribute(description="Specifies the html5 type element to display. e.g. text, email, url", defaultValue="text") + @StrutsTagAttribute(description = "Specifies the html5 type element to display. e.g. text, email, url", defaultValue = "text") public void setType(String type) { this.type = type; }