https://bz.apache.org/bugzilla/show_bug.cgi?id=60027

--- Comment #8 from George Bateman <[email protected]> ---
That implementation looks ideal; one problem with the Map<String,String> though
is the alphabetical sort on the parts. Sorting e.g. parts 1-10 will give the
wrong order. Two alternatives are:
• String array with size set to the number of partN attributes. For each
attribute, run
    partsArray[Integer.parseInt(N) - 1] = value;
  and on catching an ArrayIndexOutOfBounds exception fail the task with the
message "part numbers not consecutive" or "part numbers start at 1".

• Just fill and sort a Map<Integer,String>. This would allow non-consecutive
part numbers, if you want that.

The use case is when a single argument can be subdivided into many logical
parts, and writing them all out joined together is too long to read clearly, as
with complex sed commands, regexes acting on paths or other long texts, and the
sh -c command. As you say, using <fileset>/<pathconvert> instead of hard-coded
values would usually be better when that is appropriate.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to