From 5e8f1c029bf76e027a30efb35a476a5d9aedc137 Mon Sep 17 00:00:00 2001 From: Wolf Posdorfer Date: Mon, 30 May 2011 11:31:02 +0000 Subject: [PATCH] adding Generics to Iterators without git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@12431 b35dd754-fafc-0310-a699-88a17e54d16e --- source/org/jivesoftware/smackx/ReportedData.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/source/org/jivesoftware/smackx/ReportedData.java b/source/org/jivesoftware/smackx/ReportedData.java index 0d7b760a0..02325849c 100644 --- a/source/org/jivesoftware/smackx/ReportedData.java +++ b/source/org/jivesoftware/smackx/ReportedData.java @@ -23,6 +23,7 @@ package org.jivesoftware.smackx; import org.jivesoftware.smack.packet.Packet; import org.jivesoftware.smack.packet.PacketExtension; import org.jivesoftware.smackx.packet.DataForm; +import org.jivesoftware.smackx.packet.DataForm.Item; import java.util.ArrayList; import java.util.Collections; @@ -69,18 +70,18 @@ public class ReportedData { */ private ReportedData(DataForm dataForm) { // Add the columns to the report based on the reported data fields - for (Iterator fields = dataForm.getReportedData().getFields(); fields.hasNext();) { - FormField field = (FormField)fields.next(); + for (Iterator fields = dataForm.getReportedData().getFields(); fields.hasNext();) { + FormField field = fields.next(); columns.add(new Column(field.getLabel(), field.getVariable(), field.getType())); } // Add the rows to the report based on the form's items - for (Iterator items = dataForm.getItems(); items.hasNext();) { - DataForm.Item item = (DataForm.Item)items.next(); + for (Iterator items = dataForm.getItems(); items.hasNext();) { + Item item = items.next(); List fieldList = new ArrayList(columns.size()); FormField field; - for (Iterator fields = item.getFields(); fields.hasNext();) { - field = (FormField) fields.next(); + for (Iterator fields = item.getFields(); fields.hasNext();) { + field = fields.next(); // The field is created with all the values of the data form's field List values = new ArrayList(); for (Iterator it=field.getValues(); it.hasNext();) { @@ -231,7 +232,7 @@ public class ReportedData { * @param variable the variable to match. * @return the values of the field whose variable matches the requested variable. */ - public Iterator getValues(String variable) { + public Iterator getValues(String variable) { for(Iterator it=getFields();it.hasNext();) { Field field = it.next(); if (variable.equalsIgnoreCase(field.getVariable())) {