Skip to content

Commit

Permalink
WW-2069 Drops "id" and "name" attributes" on the tags where they are …
Browse files Browse the repository at this point in the history
…deprecated.
  • Loading branch information
aleksandr-m committed Nov 2, 2015
1 parent 2b4d379 commit f8718f9
Show file tree
Hide file tree
Showing 31 changed files with 23 additions and 177 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
*
* <!-- START SNIPPET: params -->
* <ul>
* <li>id (String) - the id of which if supplied will have the resultant
* <li>var (String) - the name of which if supplied will have the resultant
* appended iterator stored under in the stack's context</li>
* </ul>
* <!-- END SNIPPET: params -->
Expand Down
11 changes: 0 additions & 11 deletions core/src/main/java/org/apache/struts2/components/ContextBean.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,6 @@ public void setVar(String var) {
}
}

/**
* To keep backward compatibility
* TODO remove after 2.1
*
* @param id the given id
*/
@StrutsTagAttribute(description="Deprecated. Use 'var' instead")
public void setId(String id) {
setVar(id);
}

protected String getVar() {
return this.var;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
*
* <!-- START SNIPPET: params -->
* <ul>
* <li>id (String) - the id where the resultant merged iterator will be stored in the stack's context</li>
* <li>var (String) - the name where the resultant merged iterator will be stored in the stack's context</li>
* </ul>
* <!-- END SNIPPET: params -->
*
Expand Down
12 changes: 2 additions & 10 deletions core/src/main/java/org/apache/struts2/components/Set.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
*
* <ul>
*
* <li>name* (String): The name of the new variable that is assigned the value of <i>value</i></li>
* <li>var* (String): The name of the new variable that is assigned the value of <i>value</i></li>
*
* <li>value (Object): The value that is assigned to the variable named <i>name</i></li>
*
Expand Down Expand Up @@ -123,19 +123,11 @@ public boolean end(Writer writer, String body) {
return super.end(writer, body);
}

/*
* TODO: set required=true when 'id' is dropped after 2.1
*/
@StrutsTagAttribute(description="Name used to reference the value pushed into the Value Stack")
@StrutsTagAttribute(required=true, description="Name used to reference the value pushed into the Value Stack")
public void setVar(String var) {
super.setVar(var);
}

@StrutsTagAttribute(description="Deprecated. Use 'var' instead")
public void setName(String name) {
setVar(name);
}

@StrutsTagAttribute(description="The scope in which to assign the variable. Can be <b>application</b>" +
", <b>session</b>, <b>request</b>, <b>page</b>, or <b>action</b>.", defaultValue="action")
public void setScope(String scope) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,4 @@ protected void populateParams() {
public void setVar(String var) {
this.var = var;
}

/**
* To keep backward compatibility
* TODO remove after 2.1
*/
public void setId(String id) {
setVar(id);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,6 @@ public void setConverter(String aConverter) {
converterAttr = aConverter;
}

@StrutsTagAttribute(description="Deprecated. Use 'var' instead")
public void setId(String string) {
setVar(string);
}

@StrutsTagAttribute(description="The name to store the resultant iterator into page context, if such name is supplied")
public void setVar(String var) {
this.var = var;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
* <!-- START SNIPPET: params -->
*
* <ul>
* <li>id (String) - if specified, the sorted iterator will be place with this id under page context</li>
* <li>var (String) - if specified, the sorted iterator will be place with this name under page context</li>
* <li>source (Object) - the source for the sort to take place (should be iteratable) else JspException will be thrown</li>
* <li>comparator* (Object) - the comparator used to do sorting (should be a type of Comparator or its decendent) else JspException will be thrown</li>
* </ul>
Expand Down Expand Up @@ -109,11 +109,6 @@ public void setSource(String source) {
sourceAttr = source;
}

@StrutsTagAttribute(description="Deprecated. Use 'var' instead")
public void setId(String string) {
setVar(string);
}

@StrutsTagAttribute(description="The name to store the resultant iterator into page context, if such name is supplied")
public void setVar(String var) {
this.var = var;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,6 @@ public void setDecider(String decider) {
deciderAttr = decider;
}

@StrutsTagAttribute(description="Deprecated. Use 'var' instead")
public void setId(String string) {
setVar(string);
}

@StrutsTagAttribute(description="The name to store the resultant iterator into page context, if such name is supplied")
public void setVar(String var) {
this.var = var;
Expand Down
8 changes: 0 additions & 8 deletions core/src/site/resources/tags/action.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,6 @@ <h2>Attributes</h2>
<td align="left" valign="top">Boolean</td>
<td align="left" valign="top">Whether the writer should be flush upon end of action component tag, default to true</td>
</tr>
<tr>
<td align="left" valign="top">id</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">String</td>
<td align="left" valign="top">Deprecated. Use 'var' instead</td>
</tr>
<tr>
<td align="left" valign="top">ignoreContextParams</td>
<td align="left" valign="top">false</td>
Expand Down
8 changes: 0 additions & 8 deletions core/src/site/resources/tags/append.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,6 @@ <h2>Attributes</h2>
<th align="left" valign="top"><h4>Type</h4></th>
<th align="left" valign="top"><h4>Description</h4></th>
</tr>
<tr>
<td align="left" valign="top">id</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">String</td>
<td align="left" valign="top">Deprecated. Use 'var' instead</td>
</tr>
<tr>
<td align="left" valign="top">var</td>
<td align="left" valign="top">false</td>
Expand Down
8 changes: 0 additions & 8 deletions core/src/site/resources/tags/bean.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,6 @@ <h2>Attributes</h2>
<th align="left" valign="top"><h4>Type</h4></th>
<th align="left" valign="top"><h4>Description</h4></th>
</tr>
<tr>
<td align="left" valign="top">id</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">String</td>
<td align="left" valign="top">Deprecated. Use 'var' instead</td>
</tr>
<tr>
<td align="left" valign="top">name</td>
<td align="left" valign="top"><strong>true</strong></td>
Expand Down
8 changes: 0 additions & 8 deletions core/src/site/resources/tags/date.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,6 @@ <h2>Attributes</h2>
<td align="left" valign="top">String</td>
<td align="left" valign="top">Date or DateTime format pattern</td>
</tr>
<tr>
<td align="left" valign="top">id</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">String</td>
<td align="left" valign="top">Deprecated. Use 'var' instead</td>
</tr>
<tr>
<td align="left" valign="top">name</td>
<td align="left" valign="top"><strong>true</strong></td>
Expand Down
8 changes: 0 additions & 8 deletions core/src/site/resources/tags/generator.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,6 @@ <h2>Attributes</h2>
<td align="left" valign="top">Integer</td>
<td align="left" valign="top">The max number entries to be in the iterator</td>
</tr>
<tr>
<td align="left" valign="top">id</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">String</td>
<td align="left" valign="top">Deprecated. Use 'var' instead</td>
</tr>
<tr>
<td align="left" valign="top">separator</td>
<td align="left" valign="top"><strong>true</strong></td>
Expand Down
8 changes: 0 additions & 8 deletions core/src/site/resources/tags/iterator.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,6 @@ <h2>Attributes</h2>
<td align="left" valign="top">Integer</td>
<td align="left" valign="top">if specified the iteration will end on that index(inclusive)</td>
</tr>
<tr>
<td align="left" valign="top">id</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">String</td>
<td align="left" valign="top">Deprecated. Use 'var' instead</td>
</tr>
<tr>
<td align="left" valign="top">status</td>
<td align="left" valign="top">false</td>
Expand Down
8 changes: 0 additions & 8 deletions core/src/site/resources/tags/merge.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,6 @@ <h2>Attributes</h2>
<th align="left" valign="top"><h4>Type</h4></th>
<th align="left" valign="top"><h4>Description</h4></th>
</tr>
<tr>
<td align="left" valign="top">id</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">String</td>
<td align="left" valign="top">Deprecated. Use 'var' instead</td>
</tr>
<tr>
<td align="left" valign="top">var</td>
<td align="left" valign="top">false</td>
Expand Down
8 changes: 0 additions & 8 deletions core/src/site/resources/tags/number.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,6 @@ <h2>Attributes</h2>
<td align="left" valign="top">Boolean</td>
<td align="left" valign="top">Whether grouping is used</td>
</tr>
<tr>
<td align="left" valign="top">id</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">String</td>
<td align="left" valign="top">Deprecated. Use 'var' instead</td>
</tr>
<tr>
<td align="left" valign="top">maximumFractionDigits</td>
<td align="left" valign="top">false</td>
Expand Down
18 changes: 1 addition & 17 deletions core/src/site/resources/tags/set.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,6 @@ <h2>Attributes</h2>
<th align="left" valign="top"><h4>Type</h4></th>
<th align="left" valign="top"><h4>Description</h4></th>
</tr>
<tr>
<td align="left" valign="top">id</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">String</td>
<td align="left" valign="top">Deprecated. Use 'var' instead</td>
</tr>
<tr>
<td align="left" valign="top">name</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">String</td>
<td align="left" valign="top">Deprecated. Use 'var' instead</td>
</tr>
<tr>
<td align="left" valign="top">scope</td>
<td align="left" valign="top">false</td>
Expand All @@ -67,7 +51,7 @@ <h2>Attributes</h2>
</tr>
<tr>
<td align="left" valign="top">var</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top"><strong>true</strong></td>
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">String</td>
Expand Down
8 changes: 0 additions & 8 deletions core/src/site/resources/tags/sort.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,6 @@ <h2>Attributes</h2>
<td align="left" valign="top">java.util.Comparator</td>
<td align="left" valign="top">The comparator to use</td>
</tr>
<tr>
<td align="left" valign="top">id</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">String</td>
<td align="left" valign="top">Deprecated. Use 'var' instead</td>
</tr>
<tr>
<td align="left" valign="top">source</td>
<td align="left" valign="top">false</td>
Expand Down
8 changes: 0 additions & 8 deletions core/src/site/resources/tags/subset.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,6 @@ <h2>Attributes</h2>
<td align="left" valign="top">org.apache.struts2.util.SubsetIteratorFilter.Decider</td>
<td align="left" valign="top">Extension to plug-in a decider to determine if that particular entry is to be included in the resulting subset iterator</td>
</tr>
<tr>
<td align="left" valign="top">id</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">String</td>
<td align="left" valign="top">Deprecated. Use 'var' instead</td>
</tr>
<tr>
<td align="left" valign="top">source</td>
<td align="left" valign="top">false</td>
Expand Down
8 changes: 0 additions & 8 deletions core/src/site/resources/tags/text.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,6 @@ <h2>Attributes</h2>
<th align="left" valign="top"><h4>Type</h4></th>
<th align="left" valign="top"><h4>Description</h4></th>
</tr>
<tr>
<td align="left" valign="top">id</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">String</td>
<td align="left" valign="top">Deprecated. Use 'var' instead</td>
</tr>
<tr>
<td align="left" valign="top">name</td>
<td align="left" valign="top"><strong>true</strong></td>
Expand Down
8 changes: 0 additions & 8 deletions core/src/site/resources/tags/url.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,6 @@ <h2>Attributes</h2>
<td align="left" valign="top">Boolean</td>
<td align="left" valign="top">Specifies whether to force the addition of scheme, host and port or not</td>
</tr>
<tr>
<td align="left" valign="top">id</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">String</td>
<td align="left" valign="top">Deprecated. Use 'var' instead</td>
</tr>
<tr>
<td align="left" valign="top">includeContext</td>
<td align="left" valign="top">false</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public void testActionTagWithNamespace() {
ActionTag tag = new ActionTag();
tag.setPageContext(pageContext);
tag.setName(TestConfigurationProvider.TEST_NAMESPACE_ACTION);
tag.setId(TestConfigurationProvider.TEST_NAMESPACE_ACTION);
tag.setVar(TestConfigurationProvider.TEST_NAMESPACE_ACTION);

try {
tag.doStartTag();
Expand All @@ -79,7 +79,7 @@ public void testSimple() {
ActionTag tag = new ActionTag();
tag.setPageContext(pageContext);
tag.setName("testAction");
tag.setId("testAction");
tag.setVar("testAction");

int stackSize = stack.size();

Expand Down Expand Up @@ -117,7 +117,7 @@ public void testSimpleWithctionMethodInOriginalURI() {
ActionTag tag = new ActionTag();
tag.setPageContext(pageContext);
tag.setName("testAction");
tag.setId("testAction");
tag.setVar("testAction");

int stackSize = stack.size();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class AppendIteratorTagTest extends AbstractTagTest {
public void testAppendingIteratorUsingArrayAsSource() throws Exception {
AppendIteratorTag tag = new AppendIteratorTag();
tag.setPageContext(pageContext);
tag.setId("myAppendedIterator");
tag.setVar("myAppendedIterator");

ParamTag iterator1ParamTag = new ParamTag();
iterator1ParamTag.setPageContext(pageContext);
Expand Down Expand Up @@ -90,7 +90,7 @@ public void testAppendingIteratorUsingArrayAsSource() throws Exception {
public void testAppendingIteratorsUsingListAsSource() throws Exception {
AppendIteratorTag tag = new AppendIteratorTag();
tag.setPageContext(pageContext);
tag.setId("myAppendedIterator");
tag.setVar("myAppendedIterator");

ParamTag iterator1ParamTag = new ParamTag();
iterator1ParamTag.setPageContext(pageContext);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public void testGeneratorWithId() throws Exception {
IteratorGeneratorTag tag = new IteratorGeneratorTag();
tag.setPageContext(pageContext);
tag.setVal("%{'aaa,bbb,ccc,ddd,eee'}");
tag.setId("myPageContextAttId");
tag.setVar("myPageContextAttId");
tag.doStartTag();
tag.doEndTag();

Expand Down
Loading

0 comments on commit f8718f9

Please sign in to comment.