harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r447771 - /incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/font/TextLayout.java
Date Tue, 19 Sep 2006 07:33:52 GMT
Author: hindessm
Date: Tue Sep 19 00:33:52 2006
New Revision: 447771

URL: http://svn.apache.org/viewvc?view=rev&rev=447771
Log:
Applying new patch from "[#HARMONY-1464] [classlib][awt]compatibility:
awt.font.TextLayout() constructors with null parameters have behavior that
differs from RI".

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/font/TextLayout.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/font/TextLayout.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/font/TextLayout.java?view=diff&rev=447771&r1=447770&r2=447771
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/font/TextLayout.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/font/TextLayout.java
Tue Sep 19 00:33:52 2006
@@ -91,8 +91,20 @@
     public TextLayout(
             String string,
             Map<? extends java.text.AttributedCharacterIterator.Attribute, ?> attributes,
-            FontRenderContext frc
-    ) {
+            FontRenderContext frc ) {
+        if (string == null){
+            throw new IllegalArgumentException(Messages.getString("awt.01", "string")); //$NON-NLS-1$
//$NON-NLS-2$
+        }
+        
+        if (attributes == null){
+            throw new IllegalArgumentException(Messages.getString("awt.01", "attributes"));
//$NON-NLS-1$ //$NON-NLS-2$
+        }
+        
+        if (string.length() == 0){
+            throw new IllegalArgumentException(Messages.getString("awt.02", "string")); //$NON-NLS-1$
//$NON-NLS-2$
+        }
+        
+        
         AttributedString as = new AttributedString(string);
         as.addAttributes(attributes, 0, string.length());
         this.breaker = new TextRunBreaker(as.getIterator(), frc);



Mime
View raw message