This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

FYI: Patch: java.util.Locale


Hi list,


I just commited the attached patch to trunk to fix some string 
comparison issues.


Michael


2004-03-11  Michael Koch  <konqueror@gmx.de>

	* java/util/Locale.java
	(getISO3Language): Use String.equals() instead of ==.
	(getISO3Country): Likewise.

Index: java/util/Locale.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/util/Locale.java,v
retrieving revision 1.15
diff -u -b -B -r1.15 Locale.java
--- java/util/Locale.java	18 Sep 2003 06:34:00 -0000	1.15
+++ java/util/Locale.java	11 Mar 2004 16:26:30 -0000
@@ -436,7 +436,7 @@
    */
   public String getISO3Language()
   {
-    if (language == "")
+    if (language.equals(""))
       return "";
     int index
       = ("aa,ab,af,am,ar,as,ay,az,ba,be,bg,bh,bi,bn,bo,br,ca,co,cs,cy,da,"
@@ -472,7 +472,7 @@
    */
   public String getISO3Country()
   {
-    if (country == "")
+    if (country.equals(""))
       return "";
     int index
       = ("AD,AE,AF,AG,AI,AL,AM,AN,AO,AQ,AR,AS,AT,AU,AW,AZ,BA,BB,BD,BE,BF,"

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]