<Swing Dev> RFR: 6215277 Typo in sun.java.accessibility.util package API documentation

Andrey Turbanov turbanoff at gmail.com
Thu Jul 25 19:16:11 UTC 2019


 Hello.
I would like to contribute a small patch for enhancement:
https://bugs.openjdk.java.net/browse/JDK-6215277
Please review and sponsor.
I'm not sure that's right mailing list. But since AccessibilityListenerList
is a copy of the Swing EventListerList class. I've also fixed typos in
originial EventListenerList.



diff --git
a/src/java.desktop/share/classes/javax/swing/event/EventListenerList.java
b/src/java.desktop/share/classes/javax/swing/event/EventListenerList.java
index 1cf242d6656..c132f11cabb 100644
---
a/src/java.desktop/share/classes/javax/swing/event/EventListenerList.java
+++
b/src/java.desktop/share/classes/javax/swing/event/EventListenerList.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights
reserved.
+ * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights
reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,7 +32,7 @@ import sun.reflect.misc.ReflectUtil;
 /**
  * A class that holds a list of EventListeners.  A single instance
  * can be used to hold all listeners (of all types) for the instance
- * using the list.  It is the responsiblity of the class using the
+ * using the list.  It is the responsibility of the class using the
  * EventListenerList to provide type-safe API (preferably conforming
  * to the JavaBeans spec) and methods which dispatch event notification
  * methods to appropriate Event Listeners on the list.
@@ -90,7 +90,7 @@ import sun.reflect.misc.ReflectUtil;
  * appropriate for short term storage or RMI between applications running
  * the same version of Swing.  As of 1.4, support for long term storage
  * of all JavaBeans™
- * has been added to the <code>java.beans</code> package.
+ * has been added to the {@code java.beans} package.
  * Please see {@link java.beans.XMLEncoder}.
  *
  * @author Georges Saab
@@ -259,7 +259,7 @@ public class EventListenerList implements Serializable {
                                  tmp.length - index);
             // set the listener array to the new array or null
             listenerList = (tmp.length == 0) ? NULL_ARRAY : tmp;
-            }
+        }
     }

     // Serialization support.
@@ -271,7 +271,7 @@ public class EventListenerList implements Serializable {
         for (int i = 0; i < lList.length; i+=2) {
             Class<?> t = (Class)lList[i];
             EventListener l = (EventListener)lList[i+1];
-            if ((l!=null) && (l instanceof Serializable)) {
+            if ((l instanceof Serializable)) {
                 s.writeObject(t.getName());
                 s.writeObject(l);
             }
diff --git
a/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/AccessibilityListenerList.java
b/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/AccessibilityListenerList.java
index 0de59f95244..a6fa6d9e6a5 100644
---
a/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/AccessibilityListenerList.java
+++
b/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/AccessibilityListenerList.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights
reserved.
+ * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights
reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,14 +26,10 @@
 package com.sun.java.accessibility.util;

 import java.util.*;
-import java.beans.*;
-import java.awt.*;
-import java.awt.event.*;
-import javax.accessibility.*;

 /**
  * <P>The {@code AccessibilityListenerList} is a copy of the Swing
- * {@link javax.swing.event.EventListenerList EventListerList} class.
+ * {@link javax.swing.event.EventListenerList EventListenerList} class.
  *
  */

@@ -160,7 +156,7 @@ public class AccessibilityListenerList {
                                  tmp.length - index);
             // set the listener array to the new array or null
             listenerList = (tmp.length == 0) ? NULL_ARRAY : tmp;
-            }
+        }
     }

     /**



Andrey Turbanov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/swing-dev/attachments/20190725/82672566/attachment.html>


More information about the swing-dev mailing list