- From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
- Date: Mon, 29 Aug 2011 07:21:04 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/2002/css-validator/org/w3c/www/mime In directory hutz:/tmp/cvs-serv18238/www/mime Modified Files: MimeType.java Log Message: genericity + updated code to 5.0 stds Index: MimeType.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/www/mime/MimeType.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- MimeType.java 14 Sep 2005 15:15:39 -0000 1.4 +++ MimeType.java 29 Aug 2011 07:21:02 -0000 1.5 @@ -5,10 +5,8 @@ package org.w3c.www.mime ; -import java.util.Vector; - -import java.io.PrintStream; import java.io.Serializable; +import java.util.ArrayList; /** * This class is used to represent parsed MIME types. @@ -345,7 +343,7 @@ while ((strl > start) && (spec.charAt (strl-1) <= ' ')) strl-- ; // get the type: - StringBuffer sb = new StringBuffer () ; + StringBuilder sb = new StringBuilder() ; while ((start < strl) && ((look = spec.charAt(start)) != '/')) { sb.append (Character.toLowerCase((char) look)) ; start++ ; @@ -369,8 +367,8 @@ if (spec.charAt(start) != ';') throw new MimeTypeFormatException (spec) ; start++ ; - Vector vp = new Vector(4) ; - Vector vv = new Vector(4) ; + ArrayList vp = new ArrayList(4) ; + ArrayList vv = new ArrayList(4) ; while ( start < strl ) { while ((start < strl) && (spec.charAt(start) <= ' ')) start++ ; // get parameter name: @@ -400,13 +398,13 @@ while ((start < strl) && (spec.charAt(start) != ';')) start++ ; start++ ; String value = sb.toString() ; - vp.addElement(name); - vv.addElement(value); + vp.add(name); + vv.add(value); } this.pnames = new String[vp.size()]; - vp.copyInto(pnames); + vp.toArray(pnames); this.pvalues = new String[vv.size()]; - vv.copyInto(pvalues); + vv.toArray(pvalues); } }
Received on Monday, 29 August 2011 07:21:12 UTC