mpoeschl 2003/08/08 09:49:45
Modified: src/java/org/apache/torque/om ComboKey.java
Log:
key is defined as SimpleKey[] - remove unecessary casts and checks
Revision Changes Path
1.13 +9 -10 db-torque/src/java/org/apache/torque/om/ComboKey.java
Index: ComboKey.java
===================================================================
RCS file: /home/cvs/db-torque/src/java/org/apache/torque/om/ComboKey.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- ComboKey.java 12 Dec 2002 12:53:11 -0000 1.12
+++ ComboKey.java 8 Aug 2003 16:49:45 -0000 1.13
@@ -3,7 +3,7 @@
/* ====================================================================
* The Apache Software License, Version 1.1
*
- * Copyright (c) 2001-2002 The Apache Software Foundation. All rights
+ * Copyright (c) 2001-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -212,7 +212,7 @@
{
// check that all keys are not null
isEqual = true;
- SimpleKey[] keys = (SimpleKey []) key;
+ SimpleKey[] keys = key;
for (int i = 0; i < keys.length && isEqual; i++)
{
isEqual &= keys[i] != null && keys[i].getValue() != null;
@@ -263,18 +263,17 @@
SimpleKey[] obj = (SimpleKey[])
((ComboKey) keyObj).getValue();
- SimpleKey[] keys1 = (SimpleKey[]) key;
- SimpleKey[] keys2 = (SimpleKey[]) obj;
+ SimpleKey[] keys1 = key;
+ SimpleKey[] keys2 = obj;
isEqual = keys1.length == keys2.length;
for (int i = 0; i < keys1.length && isEqual; i++)
{
isEqual &= ObjectUtils.equals(keys1[i], keys2[i]);
}
}
- else if (keyObj instanceof SimpleKey[]
- && key instanceof SimpleKey[])
+ else if (keyObj instanceof SimpleKey[])
{
- SimpleKey[] keys1 = (SimpleKey[]) key;
+ SimpleKey[] keys1 = key;
SimpleKey[] keys2 = (SimpleKey[]) keyObj;
isEqual = keys1.length == keys2.length;
for (int i = 0; i < keys1.length && isEqual; i++)
@@ -295,7 +294,7 @@
{
if (key != null)
{
- SimpleKey[] keys = (SimpleKey[]) key;
+ SimpleKey[] keys = key;
for (int i = 0; i < keys.length; i++)
{
if (keys[i] != null)
@@ -339,7 +338,7 @@
return super.hashCode();
}
- SimpleKey sk = ((SimpleKey[]) key)[0];
+ SimpleKey sk = key[0];
if (sk == null)
{
return super.hashCode();
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]