harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apetre...@apache.org
Subject svn commit: r507012 - /harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JTextField.java
Date Tue, 13 Feb 2007 14:09:29 GMT
Author: apetrenko
Date: Tue Feb 13 06:09:28 2007
New Revision: 507012

URL: http://svn.apache.org/viewvc?view=rev&rev=507012
Log:
Patch for HARMONY-3166 "[classlib][swing] j.s.text.JTextField has compiler warnings"

Modified:
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JTextField.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JTextField.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JTextField.java?view=diff&rev=507012&r1=507011&r2=507012
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JTextField.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JTextField.java
Tue Feb 13 06:09:28 2007
@@ -29,9 +29,9 @@
 import java.awt.Rectangle;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
-import java.awt.event.KeyEvent;
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
+
 import javax.accessibility.AccessibleContext;
 import javax.accessibility.AccessibleState;
 import javax.accessibility.AccessibleStateSet;
@@ -49,14 +49,23 @@
 import org.apache.harmony.awt.text.PropertyNames;
 import org.apache.harmony.awt.text.TextFieldKit;
 
-
+/**
+ * Note: <code>serialVersionUID</code> fields in this class and its inner
+ * classes are added as a performance optimization but not as a guarantee of
+ * correct deserialization of the classes. 
+ */
 public class JTextField extends JTextComponent implements SwingConstants {
+
     protected class AccessibleJTextField extends
             JTextComponent.AccessibleJTextComponent {
+
+        private static final long serialVersionUID = -3980593114771538955L;
+
         protected AccessibleJTextField() {
             super();
         }
 
+        @Override
         public AccessibleStateSet getAccessibleStateSet() {
             AccessibleStateSet ass = super.getAccessibleStateSet();
             ass.add(AccessibleState.SINGLE_LINE);
@@ -66,6 +75,12 @@
 
     public static final String notifyAction = "notify-field-accept";
 
+    /**
+     * This field is added as a performance optimization but not as
+     * a guarantee of correct deserialization of the class. 
+     */
+    private static final long serialVersionUID = 6111025777502333651L;
+
     private int columns;
 
     private int columnWidth;
@@ -107,6 +122,8 @@
     }
 
     static class NotifyAction extends TextAction {
+        private static final long serialVersionUID = 7892443630033381907L;
+
         public NotifyAction(final String name) {
             super(name);
         }
@@ -120,6 +137,7 @@
             ((JTextField)focused).postActionEvent();
         }
 
+        @Override
         public boolean isEnabled() {
             final JTextComponent focused = getFocusedComponent();
             if (!(focused instanceof JTextField)) {
@@ -281,6 +299,7 @@
 
     }
 
+    @Override
     public AccessibleContext getAccessibleContext() {
         if (accessibleContext == null) {
             accessibleContext = new AccessibleJTextField();
@@ -293,10 +312,10 @@
     }
 
     public ActionListener[] getActionListeners() {
-        return (ActionListener[]) listenerList
-                .getListeners(ActionListener.class);
+        return listenerList.getListeners(ActionListener.class);
     }
 
+    @Override
     public Action[] getActions() {
         Action[] editorKitActions = ((TextUI) ui).getEditorKit(this)
                 .getActions();
@@ -334,6 +353,7 @@
         return (diff >= 0) ? diff + 1 : 0;
     }
 
+    @Override
     public Dimension getPreferredSize() {
         int widthColumns = columns * columnWidth;
         Dimension dim = super.getPreferredSize();
@@ -345,10 +365,12 @@
         return scrollOffset;
     }
 
+    @Override
     public String getUIClassID() {
         return uiClassID;
     }
 
+    @Override
     public boolean isValidateRoot() {
         Container parent = getParent();
         return parent == null || !(parent instanceof JViewport);
@@ -361,6 +383,7 @@
      *     Object obj = new JTextField();
      *     System.out.println(obj.toString());
      */
+    @Override
     protected String paramString() {
         return super.paramString() + "," + "columns=" + getColumns() + ","
                 + "columnWidth=" + getColumnWidth() + "," + "command="
@@ -376,6 +399,7 @@
         listenerList.remove(ActionListener.class, actionListener);
     }
 
+    @Override
     public void scrollRectToVisible(final Rectangle r) {
         int x = r.x;
         Insets insets = getInsets();
@@ -438,6 +462,7 @@
 
     }
 
+    @Override
     public void setDocument(final Document doc) {
         super.setDocument(doc);
         if (doc != null) {
@@ -445,6 +470,7 @@
         }
     }
 
+    @Override
     public void setFont(final Font f) {
         super.setFont(f);
         evaluate(f);



Mime
View raw message