This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
FYI: Patch: gnu.java.lang.ArrayHelper
- From: Michael Koch <konqueror at gmx dot de>
- To: java-patches at gcc dot gnu dot org
- Date: Sat, 2 Aug 2003 11:20:18 +0200
- Subject: FYI: Patch: gnu.java.lang.ArrayHelper
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi list,
I commited the attached obvious patch tp add method documentation to
gnu.java.lang.ArrayHelper.
Michael
- --
Homepage: http://www.worldforge.org/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
iD8DBQE/K4JkWSOgCCdjSDsRAjbTAKCWIiaFUVHLDAX8aZT8r7vqhZyt8ACeOO7G
XwSEmnah3B6c6jD/x+oMQTA=
=MMus
-----END PGP SIGNATURE-----
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/libjava/ChangeLog,v
retrieving revision 1.2080
diff -u -b -B -r1.2080 ChangeLog
--- ChangeLog 2 Aug 2003 06:31:02 -0000 1.2080
+++ ChangeLog 2 Aug 2003 09:09:42 -0000
@@ -1,5 +1,10 @@
2003-08-02 Michael Koch <konqueror@gmx.de>
+ * gnu/java/lang/ArrayHelper.java
+ (equalsArray): Reformated, added method documentation.
+
+2003-08-02 Michael Koch <konqueror@gmx.de>
+
* java/net/URL.java
(URL): Added paragraph about the
gnu.java.net.nocache_protocol_handlers property.
Index: gnu/java/lang/ArrayHelper.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/java/lang/ArrayHelper.java,v
retrieving revision 1.3
diff -u -b -B -r1.3 ArrayHelper.java
--- gnu/java/lang/ArrayHelper.java 17 Jun 2003 12:01:37 -0000 1.3
+++ gnu/java/lang/ArrayHelper.java 2 Aug 2003 09:09:42 -0000
@@ -76,16 +76,22 @@
return -1;
}
- public static boolean equalsArray(Object[] a, Object[] b) {
- if(a.length == b.length) {
- for(int i=0;i<a.length;i++) {
- if(!a[i].equals(b[i])) {
+ /**
+ * Checks if two arrays are equal.
+ *
+ * @param array1 the first array
+ * @param array2 the second array
+ * @return true if both arrays are equal.
+ */
+ public static boolean equalsArray(Object[] array1, Object[] array2)
+ {
+ if (array1.length != array2.length)
return false;
- }
- }
- return true;
- } else {
+
+ for (int index = 0; index < array1.length; index++)
+ if (!array1 [index].equals (array2 [index]))
return false;
- }
+
+ return true;
}
}