harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apetre...@apache.org
Subject svn commit: r504134 - in /harmony/enhanced/classlib/trunk/modules: awt/src/main/java/common/org/apache/harmony/awt/text/ swing/src/main/java/common/javax/swing/text/
Date Tue, 06 Feb 2007 13:29:40 GMT
Author: apetrenko
Date: Tue Feb  6 05:29:39 2007
New Revision: 504134

URL: http://svn.apache.org/viewvc?view=rev&rev=504134
Log:
Patch for HARMONY-2782 "[classlib][swing] j.s.text.DefaultCaret.install doesn't throw NPE
whereas RI does"

Modified:
    harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/text/TextCaret.java
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/AWTCaret.java
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/DefaultCaret.java
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/JTextComponent.java

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/text/TextCaret.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/text/TextCaret.java?view=diff&rev=504134&r1=504133&r2=504134
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/text/TextCaret.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/text/TextCaret.java
Tue Feb  6 05:29:39 2007
@@ -46,7 +46,7 @@
 
     void paint(Graphics g);
 
-    boolean setComponent(final Component c);
+    void setComponent(final Component c);
 
     AWTHighlighter getHighlighter();
 }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/AWTCaret.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/AWTCaret.java?view=diff&rev=504134&r1=504133&r2=504134
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/AWTCaret.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/AWTCaret.java
Tue Feb  6 05:29:39 2007
@@ -65,12 +65,10 @@
 
     }
 
-    public boolean setComponent(final Component c) {
-        if (super.setComponent(c)) {
-            highlighter.setComponent(c);
-        }
+    public void setComponent(final Component c) {
+        super.setComponent(c);
+        highlighter.setComponent(c);
         textKit.addCaretListeners(this);
-        return true;
     }
 
     Object createTimer(final boolean isMagicTimer, final int delay) {

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/DefaultCaret.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/DefaultCaret.java?view=diff&rev=504134&r1=504133&r2=504134
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/DefaultCaret.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/DefaultCaret.java
Tue Feb  6 05:29:39 2007
@@ -681,9 +681,8 @@
         if (c == null) { // Fix for HARMONY-1750, for compatiblity with RI
             throw new NullPointerException(Messages.getString("swing.05")); //$NON-NLS-1$
         }
-        if (!setComponent(c)) {
-            return;
-        }
+        setComponent(c);
+
         component.addMouseListener(this);
         component.addMouseMotionListener(this);
         component.addFocusListener(this);
@@ -694,10 +693,7 @@
                                         selectionColor);
     }
 
-    boolean setComponent(final Component c) {
-        if (c == null) {
-            return false;
-        }
+    void setComponent(final Component c) {
         component = c;
         textKit = TextUtils.getTextKit(component);
         document = textKit.getDocument();
@@ -707,7 +703,6 @@
         }
         selectionColor = getSelectionColor();
         caretColor = getCaretColor();
-        return true;
     }
 
     public boolean isActive() {

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/JTextComponent.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/JTextComponent.java?view=diff&rev=504134&r1=504133&r2=504134
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/JTextComponent.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/JTextComponent.java
Tue Feb  6 05:29:39 2007
@@ -718,8 +718,7 @@
             public AWTHighlighter getHighlighter() {
                 return null;
             }
-            public boolean setComponent(final Component c) {
-                return false;
+            public void setComponent(final Component c) {
             }
             public void paint(final Graphics g) {
 



Mime
View raw message