if (key1.getValueType() != key2.getValueType()) return false ;
} catch (InvalidRegistryException e) {
return false ;
}
RegistryValueType type ;
try {
type = key1.getValueType() ;
if (type.equals(RegistryValueType.ASCII)) {
if (!key1.getAsciiValue().equals(key2.getAsciiValue()))
return false ;
} else
if (type.equals(RegistryValueType.STRING)) {
if (!key1.getStringValue().equals(key2.getStringValue()))
return false ;
} else
if (type.equals(RegistryValueType.LONG)) {
if (key1.getLongValue() != key2.getLongValue())
return false ;
} else
if (type.equals(RegistryValueType.BINARY)) {
byte[] bin1 = key1.getBinaryValue() ;
byte[] bin2 = key2.getBinaryValue() ;
if (bin1.length != bin2.length)
return false ;
for (int i = 0; i < bin1.length; i++)
if (bin1[i] != bin2[i]) return false ;
} else
if (type.equals(RegistryValueType.ASCIILIST)) {
String[] list1 = key1.getAsciiListValue() ;
String[] list2 = key2.getAsciiListValue() ;
if (list1.length != list2.length)
return false ;
for (int i = 0; i < list1.length; i++)
if (!list1[i].equals(list2[i])) return false ;
} else
if (type.equals(RegistryValueType.STRINGLIST)) {
String[] list1 = key1.getStringListValue() ;
String[] list2 = key2.getStringListValue() ;
if (list1.length != list2.length)
return false ;
for (int i = 0; i < list1.length; i++)
if (!list1[i].equals(list2[i])) return false ;
} else
if (type.equals(RegistryValueType.LONGLIST)) {
int[] list1 = key1.getLongListValue() ;
int[] list2 = key2.getLongListValue() ;
if (list1.length != list2.length)
return false ;
for (int i = 0; i < list1.length; i++)