package gui.property;

import util.StringUtil;

public class PropertyUtil
{
	public static String getPropertyMD5(Property p[])
	{
		return getPropertyMD5(p, "");
	}

	public static String getPropertyMD5(Property p[], String additionalParam)
	{
		if (p == null)
			return "no-props";
		String s = additionalParam;
		for (Property property : p)
			s += property.getUniqueName() + " " + property.getValue();
		return StringUtil.getMD5(s);
	}

	public static String toString(Property p[])
	{
		if (p == null || p.length == 0)
			return "";
		String s = "";
		for (Property property : p)
			s += property.getName() + " " + property.getValue() + ", ";
		s = s.substring(0, s.length() - 2);
		return s;
	}

	public static Property getProperty(Property[] properties, String name)
	{
		if (properties == null || properties.length == 0)
			return null;
		for (Property p : properties)
			if (p.getName().equals(name))
				return p;
		return null;
	}
}

@@ -233,24 +233,54 @@
 alParam)%0A%09%7B%0A
+%09%09String s = additionalParam;%0A
 %09%09if (p == n
@@ -287,22 +287,20 @@
 ull)%0A%09%09%09
-return
+s +=
  %22no-pro
@@ -310,36 +310,14 @@
 ;%0A%09%09
-String s = additionalParam;%0A
+else%0A%09
 %09%09fo
@@ -334,32 +334,33 @@
 y property : p)%0A
+%09
 %09%09%09s += property

fix wrong md5 when no params where configured