javauis/lcdui_qt/src/javax/microedition/lcdui/Font.java
changeset 35 85266cc22c7f
parent 23 98ccebc37403
child 80 d6dafc5d983f
--- a/javauis/lcdui_qt/src/javax/microedition/lcdui/Font.java	Thu May 27 12:49:31 2010 +0300
+++ b/javauis/lcdui_qt/src/javax/microedition/lcdui/Font.java	Fri Jun 11 13:33:44 2010 +0300
@@ -459,7 +459,14 @@
      */
     public int charsWidth(char[] c, int offset, int length)
     {
-        return stringWidth(new String(c, offset, length));
+        try 
+        {
+           final String string = new String(c, offset, length);
+           return stringWidth(string);
+        }catch (StringIndexOutOfBoundsException ex) 
+        {
+            throw new ArrayIndexOutOfBoundsException();
+        }
     }
 
     /**