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]

MessageFormat


It's illegal to catch a checked exception which is never thrown from 
within a corresponding try block. I guess GCJ doesn't detect this error, 
but javac picked it up when I was building classpath.

regards

Bryce.


2001-09-05  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>

        * java/text/MessageFormat.java (setLocale): Don't catch 
ParseException
        here, DecimalFormat.applyPattern() does not throw it.

--- MessageFormat.java  2001/09/05 00:00:55     1.7
+++ MessageFormat.java  2001/09/05 07:23:57
@@ -88,14 +88,7 @@
            {
              format = NumberFormat.getNumberInstance(loc);
              DecimalFormat df = (DecimalFormat) format;
-             try
-               {
-                 df.applyPattern(style);
-               }
-             catch (ParseException x)
-               {
-                 throw new IllegalArgumentException (x.getMessage());
-               }
+             df.applyPattern(style);
            }
        }




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