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/10/27 21:31:31 UTC
svn commit: r1536195 -
/commons/proper/beanutils/branches/java5/src/test/java/org/apache/commons/beanutils/TestBean.java
Author: oheger
Date: Sun Oct 27 20:31:31 2013
New Revision: 1536195
URL: http://svn.apache.org/r1536195
Log:
Fixed raw type warnings in TestBean class.
Modified:
commons/proper/beanutils/branches/java5/src/test/java/org/apache/commons/beanutils/TestBean.java
Modified: commons/proper/beanutils/branches/java5/src/test/java/org/apache/commons/beanutils/TestBean.java
URL: http://svn.apache.org/viewvc/commons/proper/beanutils/branches/java5/src/test/java/org/apache/commons/beanutils/TestBean.java?rev=1536195&r1=1536194&r2=1536195&view=diff
==============================================================================
--- commons/proper/beanutils/branches/java5/src/test/java/org/apache/commons/beanutils/TestBean.java (original)
+++ commons/proper/beanutils/branches/java5/src/test/java/org/apache/commons/beanutils/TestBean.java Sun Oct 27 20:31:31 2013
@@ -19,11 +19,11 @@
package org.apache.commons.beanutils;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import java.io.Serializable;
/**
@@ -93,7 +93,7 @@ public class TestBean implements Seriali
setStringProperty(stringProperty);
}
- public TestBean(List listIndexed) {
+ public TestBean(List<Object> listIndexed) {
this.listIndexed = listIndexed;
}
@@ -269,9 +269,9 @@ public class TestBean implements Seriali
/**
* A List property accessed as an indexed property.
*/
- private List listIndexed = new ArrayList();
+ private List<Object> listIndexed = new ArrayList<Object>();
- public List getListIndexed() {
+ public List<Object> getListIndexed() {
return (listIndexed);
}
@@ -293,22 +293,22 @@ public class TestBean implements Seriali
/**
* A mapped property with only a getter and setter for a Map.
*/
- private Map mapProperty = null;
+ private Map<String, Object> mapProperty = null;
- public Map getMapProperty() {
+ public Map<String, Object> getMapProperty() {
// Create the map the very first time
if (mapProperty == null) {
- mapProperty = new HashMap();
+ mapProperty = new HashMap<String, Object>();
mapProperty.put("First Key", "First Value");
mapProperty.put("Second Key", "Second Value");
}
return (mapProperty);
}
- public void setMapProperty(Map mapProperty) {
+ public void setMapProperty(Map<String, Object> mapProperty) {
// Create the map the very first time
if (mapProperty == null) {
- mapProperty = new HashMap();
+ mapProperty = new HashMap<String, Object>();
mapProperty.put("First Key", "First Value");
mapProperty.put("Second Key", "Second Value");
}
@@ -319,12 +319,12 @@ public class TestBean implements Seriali
/**
* A mapped property that has String keys and Object values.
*/
- private HashMap mappedObjects = null;
+ private HashMap<String, Object> mappedObjects = null;
public Object getMappedObjects(String key) {
// Create the map the very first time
if (mappedObjects == null) {
- mappedObjects = new HashMap();
+ mappedObjects = new HashMap<String, Object>();
mappedObjects.put("First Key", "First Value");
mappedObjects.put("Second Key", "Second Value");
}
@@ -334,7 +334,7 @@ public class TestBean implements Seriali
public void setMappedObjects(String key, Object value) {
// Create the map the very first time
if (mappedObjects == null) {
- mappedObjects = new HashMap();
+ mappedObjects = new HashMap<String, Object>();
mappedObjects.put("First Key", "First Value");
mappedObjects.put("Second Key", "Second Value");
}
@@ -345,22 +345,22 @@ public class TestBean implements Seriali
/**
* A mapped property that has String keys and String values.
*/
- private HashMap mappedProperty = null;
+ private HashMap<String, String> mappedProperty = null;
public String getMappedProperty(String key) {
// Create the map the very first time
if (mappedProperty == null) {
- mappedProperty = new HashMap();
+ mappedProperty = new HashMap<String, String>();
mappedProperty.put("First Key", "First Value");
mappedProperty.put("Second Key", "Second Value");
}
- return ((String) mappedProperty.get(key));
+ return (mappedProperty.get(key));
}
public void setMappedProperty(String key, String value) {
// Create the map the very first time
if (mappedProperty == null) {
- mappedProperty = new HashMap();
+ mappedProperty = new HashMap<String, String>();
mappedProperty.put("First Key", "First Value");
mappedProperty.put("Second Key", "Second Value");
}
@@ -371,21 +371,21 @@ public class TestBean implements Seriali
/**
* A mapped property that has String keys and int values.
*/
- private HashMap mappedIntProperty = null;
+ private HashMap<String, Integer> mappedIntProperty = null;
public int getMappedIntProperty(String key) {
// Create the map the very first time
if (mappedIntProperty == null) {
- mappedIntProperty = new HashMap();
- mappedIntProperty.put("One", new Integer(1));
- mappedIntProperty.put("Two", new Integer(2));
+ mappedIntProperty = new HashMap<String, Integer>();
+ mappedIntProperty.put("One", 1);
+ mappedIntProperty.put("Two", 2);
}
- Integer x = (Integer) mappedIntProperty.get(key);
+ Integer x = mappedIntProperty.get(key);
return ((x == null) ? 0 : x.intValue());
}
public void setMappedIntProperty(String key, int value) {
- mappedIntProperty.put(key, new Integer(value));
+ mappedIntProperty.put(key, value);
}