From 379ed8a0e133bee650e0acb24f6b743f657a50d0 Mon Sep 17 00:00:00 2001 From: abranson Date: Thu, 4 Aug 2011 16:08:49 +0200 Subject: Last bit of cleanup honest New castor and dependent commons libs --- source/com/c2kernel/property/PropertyUtility.java | 25 ++++++++++------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'source/com/c2kernel/property/PropertyUtility.java') diff --git a/source/com/c2kernel/property/PropertyUtility.java b/source/com/c2kernel/property/PropertyUtility.java index 40d15bd..f8e714c 100644 --- a/source/com/c2kernel/property/PropertyUtility.java +++ b/source/com/c2kernel/property/PropertyUtility.java @@ -10,6 +10,7 @@ package com.c2kernel.property; import java.util.ArrayList; +import java.util.Iterator; import com.c2kernel.persistency.ClusterStorage; import com.c2kernel.persistency.outcome.Outcome; @@ -21,36 +22,32 @@ import com.c2kernel.utils.Logger; public class PropertyUtility { - static public String getValue(ArrayList pdlist, String name) + static public String getValue(ArrayList pdlist, String name) { - Object[] values = pdlist.toArray(); - for (Object value : values) { - PropertyDescription pd = (PropertyDescription) value; + for (PropertyDescription pd : pdlist) { if ( name.equalsIgnoreCase(pd.getName()) ) return pd.getDefaultValue(); } return null; } - static public String getNames(ArrayList pdlist) + static public String getNames(ArrayList pdlist) { - Object[] values = pdlist.toArray(); StringBuffer names = new StringBuffer(); - for (Object value : values) - names.append( ((PropertyDescription)value).getDefaultValue()).append(" "); + for (PropertyDescription value : pdlist) + names.append( value.getDefaultValue()).append(" "); return names.toString(); } - static public String getClassIdNames(ArrayList pdlist) + static public String getClassIdNames(ArrayList pdlist) { - Object[] values = pdlist.toArray(); StringBuffer names = new StringBuffer(); - for (int i=0;i iter = pdlist.iterator(); iter.hasNext();) { + PropertyDescription pd = iter.next(); if (pd.getIsClassIdentifier()) names.append(pd.getName()); - if (i