You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by oh...@apache.org on 2013/11/07 22:02:23 UTC

svn commit: r1539817 - in /commons/proper/beanutils/branches/java5/src/test/java/org/apache/commons/beanutils: IndexedPropertyTestCase.java IndexedTestBean.java

Author: oheger
Date: Thu Nov  7 21:02:23 2013
New Revision: 1539817

URL: http://svn.apache.org/r1539817
Log:
Fixed warnings in test class.

Modified:
    commons/proper/beanutils/branches/java5/src/test/java/org/apache/commons/beanutils/IndexedPropertyTestCase.java
    commons/proper/beanutils/branches/java5/src/test/java/org/apache/commons/beanutils/IndexedTestBean.java

Modified: commons/proper/beanutils/branches/java5/src/test/java/org/apache/commons/beanutils/IndexedPropertyTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/beanutils/branches/java5/src/test/java/org/apache/commons/beanutils/IndexedPropertyTestCase.java?rev=1539817&r1=1539816&r2=1539817&view=diff
==============================================================================
--- commons/proper/beanutils/branches/java5/src/test/java/org/apache/commons/beanutils/IndexedPropertyTestCase.java (original)
+++ commons/proper/beanutils/branches/java5/src/test/java/org/apache/commons/beanutils/IndexedPropertyTestCase.java Thu Nov  7 21:02:23 2013
@@ -17,10 +17,10 @@
 
 package org.apache.commons.beanutils;
 
-import java.util.List;
-import java.util.ArrayList;
 import java.beans.IndexedPropertyDescriptor;
 import java.beans.PropertyDescriptor;
+import java.util.ArrayList;
+import java.util.List;
 
 import junit.framework.Test;
 import junit.framework.TestCase;
@@ -52,9 +52,9 @@ public class IndexedPropertyTestCase ext
     private PropertyUtilsBean propertyUtilsBean;
     private String[] testArray;
     private String[] newArray;
-    private List testList;
-    private List newList;
-    private ArrayList arrayList;
+    private List<String> testList;
+    private List<Object> newList;
+    private ArrayList<Object> arrayList;
 
     // ---------------------------------------------------------- Constructors
 
@@ -85,17 +85,17 @@ public class IndexedPropertyTestCase ext
         testArray= new String[] {"array-0", "array-1", "array-2"};
         newArray = new String[]  {"newArray-0", "newArray-1", "newArray-2"};
 
-        testList = new ArrayList();
+        testList = new ArrayList<String>();
         testList.add("list-0");
         testList.add("list-1");
         testList.add("list-2");
 
-        newList = new ArrayList();
+        newList = new ArrayList<Object>();
         newList.add("newList-0");
         newList.add("newList-1");
         newList.add("newList-2");
 
-        arrayList = new ArrayList();
+        arrayList = new ArrayList<Object>();
         arrayList.add("arrayList-0");
         arrayList.add("arrayList-1");
         arrayList.add("arrayList-2");
@@ -511,7 +511,7 @@ public class IndexedPropertyTestCase ext
             beanUtilsBean.setProperty(bean, "stringList", newList);
             Object value = bean.getStringList();
             assertEquals("Type is different", newList.getClass(), value.getClass());
-            List list  = (List)value;
+            List<?> list  = (List<?>)value;
             assertEquals("List size is different", newList.size(), list.size());
             for (int i = 0; i < list.size(); i++) {
                 assertEquals("Element " + i + " is different", newList.get(i), list.get(i));
@@ -571,7 +571,7 @@ public class IndexedPropertyTestCase ext
             beanUtilsBean.setProperty(bean, "arrayList", newList);
             Object value = bean.getArrayList();
             assertEquals("Type is different", newList.getClass(), value.getClass());
-            List list  = (List)value;
+            List<?> list  = (List<?>)value;
             assertEquals("List size is different", newList.size(), list.size());
             for (int i = 0; i < list.size(); i++) {
                 assertEquals("Element " + i + " is different", newList.get(i), list.get(i));

Modified: commons/proper/beanutils/branches/java5/src/test/java/org/apache/commons/beanutils/IndexedTestBean.java
URL: http://svn.apache.org/viewvc/commons/proper/beanutils/branches/java5/src/test/java/org/apache/commons/beanutils/IndexedTestBean.java?rev=1539817&r1=1539816&r2=1539817&view=diff
==============================================================================
--- commons/proper/beanutils/branches/java5/src/test/java/org/apache/commons/beanutils/IndexedTestBean.java (original)
+++ commons/proper/beanutils/branches/java5/src/test/java/org/apache/commons/beanutils/IndexedTestBean.java Thu Nov  7 21:02:23 2013
@@ -17,8 +17,8 @@
 
 package org.apache.commons.beanutils;
 
-import java.util.List;
 import java.util.ArrayList;
+import java.util.List;
 
 /**
  * Indexed Properties Test bean for JUnit tests for the "beanutils" component.
@@ -28,8 +28,8 @@ import java.util.ArrayList;
 public class IndexedTestBean {
 
     private String[] stringArray;
-    private List stringList;
-    private ArrayList arrayList;
+    private List<String> stringList;
+    private ArrayList<Object> arrayList;
 
 
     // ----------------------------------------------------------- Constructors
@@ -71,14 +71,14 @@ public class IndexedTestBean {
     /**
      * Getter for the java.util.List property.
      */
-    public List getStringList() {
+    public List<String> getStringList() {
         return stringList;
     }
 
     /**
      * Setter for the java.util.List property.
      */
-    public void setStringList(List stringList) {
+    public void setStringList(List<String> stringList) {
         this.stringList = stringList;
     }
 
@@ -86,7 +86,7 @@ public class IndexedTestBean {
      * Indexed Getter for the java.util.List property.
      */
     public String getStringList(int index) {
-        return (String)stringList.get(index);
+        return stringList.get(index);
     }
 
     /**
@@ -99,14 +99,14 @@ public class IndexedTestBean {
     /**
      * Getter for the java.util.ArrayList property.
      */
-    public ArrayList getArrayList() {
+    public ArrayList<Object> getArrayList() {
         return arrayList;
     }
 
     /**
      * Setter for the java.util.ArrayList property.
      */
-    public void setArrayList(ArrayList arrayList) {
+    public void setArrayList(ArrayList<Object> arrayList) {
         this.arrayList = arrayList;
     }