You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@turbine.apache.org by tv...@apache.org on 2018/08/15 17:31:49 UTC

svn commit: r1838118 - /turbine/core/trunk/src/java/org/apache/turbine/util/FormMessage.java

Author: tv
Date: Wed Aug 15 17:31:49 2018
New Revision: 1838118

URL: http://svn.apache.org/viewvc?rev=1838118&view=rev
Log:
Use List instead of Vector

Modified:
    turbine/core/trunk/src/java/org/apache/turbine/util/FormMessage.java

Modified: turbine/core/trunk/src/java/org/apache/turbine/util/FormMessage.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/util/FormMessage.java?rev=1838118&r1=1838117&r2=1838118&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/util/FormMessage.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/util/FormMessage.java Wed Aug 15 17:31:49 2018
@@ -1,27 +1,8 @@
 package org.apache.turbine.util;
 
 
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-
-import java.util.Vector;
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  * A message class for holding information about a message that
@@ -35,14 +16,14 @@ public class FormMessage
 {
     private String message;
     private String formName;
-    private final Vector<String> fieldNames;
+    private final List<String> fieldNames;
 
     /**
      * Constructor.
      */
     public FormMessage()
     {
-        fieldNames = new Vector<String>();
+        fieldNames = new ArrayList<String>();
     }
 
     /**
@@ -111,9 +92,7 @@ public class FormMessage
      */
     public String[] getFieldNames()
     {
-        String[] result = new String[fieldNames.size()];
-        fieldNames.copyInto(result);
-        return result;
+        return fieldNames.toArray(new String[fieldNames.size()]);
     }
 
     /**
@@ -143,7 +122,7 @@ public class FormMessage
      */
     public void setFieldName(String fieldName)
     {
-        fieldNames.addElement(fieldName);
+        fieldNames.add(fieldName);
     }
 
     /**