Why not a LinkedList? I ask because James mentioned the use of
ArrayList as a catchall collection as a petpeeve of his, when in many
cases random access is not going to be used or it will be used rarely.
I did not look to see whether that was the case here, just thought I'd
take this opportunity to invite discussion on our general tendency to
swap ArrayList for Vector, when another list type might be appropriate.
john mcnally
[EMAIL PROTECTED] wrote:
>
> dlr 02/02/27 10:16:54
>
> Modified: src/java/org/apache/maven/jrcs JDiff.java
> Log:
> Vector -> ArrayList
>
> Revision Changes Path
> 1.2 +4 -3
>jakarta-turbine-maven/src/java/org/apache/maven/jrcs/JDiff.java
>
> Index: JDiff.java
> ===================================================================
> RCS file:
>/home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/jrcs/JDiff.java,v
> retrieving revision 1.1
> retrieving revision 1.2
> diff -u -u -r1.1 -r1.2
> --- JDiff.java 27 Feb 2002 16:15:36 -0000 1.1
> +++ JDiff.java 27 Feb 2002 18:16:54 -0000 1.2
> @@ -58,8 +58,9 @@
> import java.io.BufferedReader;
> import java.io.FileReader;
> import java.io.IOException;
> +import java.util.ArrayList;
> import java.util.Date;
> -import java.util.Vector;
> +import java.util.List;
>
> import org.apache.maven.jrcs.diff.Diff;
> import org.apache.maven.jrcs.diff.Revision;
> @@ -71,11 +72,11 @@
> static final String[] loadFile(String name) throws IOException
> {
> BufferedReader data = new BufferedReader(new FileReader(name));
> - Vector lines = new Vector();
> + List lines = new ArrayList();
> String s;
> while ((s = data.readLine()) != null)
> {
> - lines.addElement(s);
> + lines.add(s);
> }
> return (String[])lines.toArray(new String[lines.size()]);
> }
>
>
>
>
> --
> To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>