Author: nbubna
Date: Fri Aug 10 09:50:04 2007
New Revision: 564672
URL: http://svn.apache.org/viewvc?view=rev&rev=564672
Log:
copy properties list when creating comparator (VELTOOLS-85), thanks to Tatyana
Modified:
velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/generic/SortTool.java
Modified:
velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/generic/SortTool.java
URL:
http://svn.apache.org/viewvc/velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/generic/SortTool.java?view=diff&rev=564672&r1=564671&r2=564672
==============================================================================
---
velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/generic/SortTool.java
(original)
+++
velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/generic/SortTool.java
Fri Aug 10 09:50:04 2007
@@ -210,9 +210,11 @@
List properties;
int[] sortTypes;
- public PropertiesComparator(List properties)
+ public PropertiesComparator(List props)
{
- this.properties = properties;
+ // copy the list so we can safely drop :asc and :desc suffixes
+ this.properties = new ArrayList(props.size());
+ this.properties.addAll(props);
// determine ascending/descending
sortTypes = new int[properties.size()];