Author: sebb
Date: Tue Sep  1 12:25:55 2009
New Revision: 810000

URL: http://svn.apache.org/viewvc?rev=810000&view=rev
Log:
Generics fixes

Modified:
    
jakarta/jmeter/trunk/src/components/org/apache/jmeter/control/ModuleController.java
    
jakarta/jmeter/trunk/src/components/org/apache/jmeter/modifiers/UserParameters.java
    
jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/DistributionGraph.java
    
jakarta/jmeter/trunk/src/core/org/apache/jmeter/testelement/property/AbstractProperty.java
    
jakarta/jmeter/trunk/src/core/org/apache/jmeter/testelement/property/CollectionProperty.java
    
jakarta/jmeter/trunk/src/core/org/apache/jmeter/testelement/property/MapProperty.java
    jakarta/jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java

Modified: 
jakarta/jmeter/trunk/src/components/org/apache/jmeter/control/ModuleController.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/components/org/apache/jmeter/control/ModuleController.java?rev=810000&r1=809999&r2=810000&view=diff
==============================================================================
--- 
jakarta/jmeter/trunk/src/components/org/apache/jmeter/control/ModuleController.java
 (original)
+++ 
jakarta/jmeter/trunk/src/components/org/apache/jmeter/control/ModuleController.java
 Tue Sep  1 12:25:55 2009
@@ -109,7 +109,7 @@
         setProperty(new CollectionProperty(NODE_PATH, nodePath));
     }
 
-    public List getNodePath() {
+    public List<?> getNodePath() {
         JMeterProperty prop = getProperty(NODE_PATH);
         if (!(prop instanceof NullProperty)) {
             return (List<?>) ((CollectionProperty) prop).getObjectValue();

Modified: 
jakarta/jmeter/trunk/src/components/org/apache/jmeter/modifiers/UserParameters.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/components/org/apache/jmeter/modifiers/UserParameters.java?rev=810000&r1=809999&r2=810000&view=diff
==============================================================================
--- 
jakarta/jmeter/trunk/src/components/org/apache/jmeter/modifiers/UserParameters.java
 (original)
+++ 
jakarta/jmeter/trunk/src/components/org/apache/jmeter/modifiers/UserParameters.java
 Tue Sep  1 12:25:55 2009
@@ -73,7 +73,7 @@
      * the same order as the sub lists that are given to
      * {...@link #setThreadLists(Collection)}.
      */
-    public void setNames(Collection list) {
+    public void setNames(Collection<?> list) {
         setProperty(new CollectionProperty(NAMES, list));
     }
 
@@ -92,7 +92,7 @@
      * values can be supplied in this fashion to cause JMeter to set different
      * values to variables for different test threads.
      */
-    public void setThreadLists(Collection threadLists) {
+    public void setThreadLists(Collection<?> threadLists) {
         setProperty(new CollectionProperty(THREAD_VALUES, threadLists));
     }
 

Modified: 
jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/DistributionGraph.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/DistributionGraph.java?rev=810000&r1=809999&r2=810000&view=diff
==============================================================================
--- 
jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/DistributionGraph.java
 (original)
+++ 
jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/DistributionGraph.java
 Tue Sep  1 12:25:55 2009
@@ -167,7 +167,7 @@
             Number fifty = p_model.getPercentPoint(0.50);
 
             int total = p_model.getCount();
-            Collection values = p_model.getDistribution().values();
+            Collection<?> values = p_model.getDistribution().values();
             Object[] objval = new Object[values.size()];
             objval = values.toArray(objval);
             // we sort the objects

Modified: 
jakarta/jmeter/trunk/src/core/org/apache/jmeter/testelement/property/AbstractProperty.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/core/org/apache/jmeter/testelement/property/AbstractProperty.java?rev=810000&r1=809999&r2=810000&view=diff
==============================================================================
--- 
jakarta/jmeter/trunk/src/core/org/apache/jmeter/testelement/property/AbstractProperty.java
 (original)
+++ 
jakarta/jmeter/trunk/src/core/org/apache/jmeter/testelement/property/AbstractProperty.java
 Tue Sep  1 12:25:55 2009
@@ -78,7 +78,7 @@
         this.runningVersion = runningVersion;
     }
 
-    protected PropertyIterator getIterator(Collection values) {
+    protected PropertyIterator getIterator(Collection<JMeterProperty> values) {
         return new PropertyIteratorImpl(values);
     }
 
@@ -246,13 +246,13 @@
      * Get the property type for this property. Used to convert raw values into
      * JMeterProperties.
      */
-    protected Class getPropertyType() {
+    protected Class<? extends AbstractProperty> getPropertyType() {
         return getClass();
     }
 
     protected JMeterProperty getBlankProperty() {
         try {
-            JMeterProperty prop = (JMeterProperty) 
getPropertyType().newInstance();
+            JMeterProperty prop = getPropertyType().newInstance();
             if (prop instanceof NullProperty) {
                 return new StringProperty();
             }
@@ -285,9 +285,9 @@
         }
     }
 
-    protected Collection normalizeList(Collection coll) {
-        Iterator iter = coll.iterator();
-        Collection newColl = null;
+    protected Collection<JMeterProperty> 
normalizeList(Collection<JMeterProperty> coll) {
+        Iterator<?> iter = coll.iterator();
+        Collection<JMeterProperty> newColl = null;
         while (iter.hasNext()) {
             Object item = iter.next();
             if (newColl == null) {
@@ -312,10 +312,10 @@
      * objects, appropriate for a MapProperty object.
      */
     protected Map normalizeMap(Map coll) {
-        Iterator iter = coll.entrySet().iterator();
-        Map newColl = null;
+        Iterator<Map.Entry<?,?>> iter = coll.entrySet().iterator();
+        Map<Object, JMeterProperty> newColl = null;
         while (iter.hasNext()) {
-            Map.Entry entry = (Map.Entry) iter.next();
+            Map.Entry<?,?> entry = iter.next();
             Object item = entry.getKey();
             Object prop = entry.getValue();
             if (newColl == null) {

Modified: 
jakarta/jmeter/trunk/src/core/org/apache/jmeter/testelement/property/CollectionProperty.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/core/org/apache/jmeter/testelement/property/CollectionProperty.java?rev=810000&r1=809999&r2=810000&view=diff
==============================================================================
--- 
jakarta/jmeter/trunk/src/core/org/apache/jmeter/testelement/property/CollectionProperty.java
 (original)
+++ 
jakarta/jmeter/trunk/src/core/org/apache/jmeter/testelement/property/CollectionProperty.java
 Tue Sep  1 12:25:55 2009
@@ -28,9 +28,9 @@
 
     private static final long serialVersionUID = 221L; // Remember to change 
this when the class changes ...
 
-    private Collection value;
+    private Collection<JMeterProperty> value;
 
-    private transient Collection savedValue;
+    private transient Collection<JMeterProperty> savedValue;
 
     public CollectionProperty(String name, Collection value) {
         super(name);
@@ -39,7 +39,7 @@
 
     public CollectionProperty() {
         super();
-        value = new ArrayList();
+        value = new ArrayList<JMeterProperty>();
     }
 
     @Override
@@ -67,33 +67,33 @@
     }
 
     public void set(int index, String prop) {
-        if (value instanceof List) {
-            ((List) value).set(index, new StringProperty(prop, prop));
+        if (value instanceof List<?>) {
+            ((List<JMeterProperty>) value).set(index, new StringProperty(prop, 
prop));
         }
     }
 
     public void set(int index, JMeterProperty prop) {
-        if (value instanceof List) {
-            ((List) value).set(index, prop);
+        if (value instanceof List<?>) {
+            ((List<JMeterProperty>) value).set(index, prop);
         }
     }
 
     public JMeterProperty get(int row) {
-        if (value instanceof List) {
-            return (JMeterProperty) ((List) value).get(row);
+        if (value instanceof List<?>) {
+            return ((List<JMeterProperty>) value).get(row);
         }
         return null;
     }
 
     public void remove(int index) {
-        if (value instanceof List) {
-            ((List) value).remove(index);
+        if (value instanceof List<?>) {
+            ((List<?>) value).remove(index);
         }
     }
 
     public void setObjectValue(Object v) {
-        if (v instanceof Collection) {
-            setCollection((Collection) v);
+        if (v instanceof Collection<?>) {
+            setCollection((Collection<?>) v);
         }
 
     }

Modified: 
jakarta/jmeter/trunk/src/core/org/apache/jmeter/testelement/property/MapProperty.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/core/org/apache/jmeter/testelement/property/MapProperty.java?rev=810000&r1=809999&r2=810000&view=diff
==============================================================================
--- 
jakarta/jmeter/trunk/src/core/org/apache/jmeter/testelement/property/MapProperty.java
 (original)
+++ 
jakarta/jmeter/trunk/src/core/org/apache/jmeter/testelement/property/MapProperty.java
 Tue Sep  1 12:25:55 2009
@@ -76,9 +76,9 @@
      * @see AbstractProperty#getPropertyType()
      */
     @Override
-    protected Class<?> getPropertyType() {
+    protected Class<? extends AbstractProperty> getPropertyType() {
         if (value.size() > 0) {
-            return valueIterator().next().getClass();
+            return (Class<? extends AbstractProperty>) 
valueIterator().next().getClass();
         }
         return NullProperty.class;
     }

Modified: jakarta/jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java?rev=810000&r1=809999&r2=810000&view=diff
==============================================================================
--- jakarta/jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java 
(original)
+++ jakarta/jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java Tue 
Sep  1 12:25:55 2009
@@ -788,7 +788,7 @@
      * namVec.
      * NOTUSED?
      */
-    public static void selJComboBoxItem(Properties properties, JComboBox 
combo, Vector namVec, String name) {
+    public static void selJComboBoxItem(Properties properties, JComboBox 
combo, Vector<?> namVec, String name) {
         int idx = namVec.indexOf(name);
         combo.setSelectedIndex(idx);
         // Redisplay.



---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscr...@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-h...@jakarta.apache.org

Reply via email to