the equals method should be in StringUtils.java since it deals only with
Strings...
-jon
----------
From: Java Apache CVS Development <[EMAIL PROTECTED]>
Reply-To: "Java-Apache Development" <[EMAIL PROTECTED]>
Date: Wed, 4 Oct 2000 17:07:54 -0700 (PDT)
To: [EMAIL PROTECTED]
Subject: CVS update: turbine/src/java/org/apache/turbine/util
ObjectUtils.java ParameterParser.java
User: gonzalo
Date: 00/10/04 17:07:54
Modified: src/java/org/apache/turbine/util ObjectUtils.java
ParameterParser.java
Log:
Added support for url.case.folding to ActionEvents; moved equals() to
ObjectUtils.
Revision Changes Path
1.4 +27 -1
turbine/src/java/org/apache/turbine/util/ObjectUtils.java
Index: ObjectUtils.java
===================================================================
RCS file:
/products/cvs/turbine/turbine/src/java/org/apache/turbine/util/ObjectUtils.j
ava,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ObjectUtils.java 2000/10/04 20:35:18 1.3
+++ ObjectUtils.java 2000/10/05 00:07:54 1.4
@@ -63,7 +63,7 @@
* This is where common Object manipulation routines should go.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Nissim Karpenstein</a>
- * @version $Id: ObjectUtils.java,v 1.3 2000/10/04 20:35:18 gonzalo Exp $
+ * @version $Id: ObjectUtils.java,v 1.4 2000/10/05 00:07:54 gonzalo Exp $
*/
public class ObjectUtils
{
@@ -100,6 +100,32 @@
if (! v.contains( o ))
{
v.addElement( o );
+ }
+ }
+
+ /**
+ * Compares two Strings, returns true if their values are the
+ * same.
+ *
+ * @param s1 The first string.
+ * @param s2 The second string.
+ * @return True if the values of both strings are the same.
+ */
+ public static boolean equals( String s1,
+ String s2 )
+ {
+ if (s1 == null)
+ {
+ return (s2 == null);
+ }
+ else if (s2 == null)
+ {
+ // s1 is not null
+ return false;
+ }
+ else
+ {
+ return s1.equals(s2);
}
}
}
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]