This patch (committed) fixes a minor bug in TreeSelectionEvent - I have a Mauve test for it that I'll commit soon:

2006-03-11  David Gilbert  <[EMAIL PROTECTED]>

        * javax/swing/event/TreeSelectionEvent.java
        (isAddedPath(TreePath)): Throw IllegalArgumentException if path is
        not one of the added/removed paths,
        (cloneWithSource): Reformatted.

Regards,

Dave
Index: javax/swing/event/TreeSelectionEvent.java
===================================================================
RCS file: 
/sources/classpath/classpath/javax/swing/event/TreeSelectionEvent.java,v
retrieving revision 1.9
diff -u -r1.9 TreeSelectionEvent.java
--- javax/swing/event/TreeSelectionEvent.java   9 Mar 2006 23:11:51 -0000       
1.9
+++ javax/swing/event/TreeSelectionEvent.java   11 Mar 2006 06:42:16 -0000
@@ -51,7 +51,8 @@
  * 
  * @author Andrew Selkirk
  */
-public class TreeSelectionEvent extends EventObject {
+public class TreeSelectionEvent extends EventObject 
+{
 
   /**
    * The paths that have been added or removed from the selection.
@@ -188,9 +189,9 @@
   {
     for (int i = paths.length - 1; i >= 0; i--)
       if (paths[i].equals(path))
-       return areNew[i];
+        return areNew[i];
 
-    return false;
+    throw new IllegalArgumentException("Unknown 'path' argument.");
   } 
 
   /**
@@ -249,9 +250,8 @@
    */
   public Object cloneWithSource(Object source)
   {
-    return new TreeSelectionEvent (source, paths, areNew,
-                                  oldLeadSelectionPath,
-                                  newLeadSelectionPath);
+    return new TreeSelectionEvent (source, paths, areNew, oldLeadSelectionPath,
+        newLeadSelectionPath);
   } 
 
 } 

Reply via email to