From 59c0460b7f96d03234af98f5f2c004b6cbd13af0 Mon Sep 17 00:00:00 2001 From: "norris%netscape.com" Date: Wed, 19 May 1999 23:58:37 +0000 Subject: [PATCH] Remove Java 2 dependency. git-svn-id: svn://10.0.0.236/trunk@32349 18797224-902f-48f8-a5cc-f745e15eee43 --- .../javascript/ListenerCollection.java | 42 ++++++++++++++++++- .../javascript/ListenerCollection.java | 42 ++++++++++++++++++- 2 files changed, 80 insertions(+), 4 deletions(-) diff --git a/mozilla/js/rhino/org/mozilla/javascript/ListenerCollection.java b/mozilla/js/rhino/org/mozilla/javascript/ListenerCollection.java index b0c74a23cc9..267f5cf93bf 100644 --- a/mozilla/js/rhino/org/mozilla/javascript/ListenerCollection.java +++ b/mozilla/js/rhino/org/mozilla/javascript/ListenerCollection.java @@ -1,5 +1,5 @@ /** - * $Id: ListenerCollection.java,v 1.1 1999-05-18 22:32:25 norris%netscape.com Exp $ + * $Id: ListenerCollection.java,v 1.2 1999-05-19 23:58:37 norris%netscape.com Exp $ * * This class provides a series of methods for accessing event listeners. * @@ -23,6 +23,42 @@ * * Revision history: * $Log: not supported by cvs2svn $ + * Revision 1.1 1999/05/18 22:32:25 norris%netscape.com + * Add submission: + * Subject: + * Re: Modified Context.java + * Date: + * Sat, 15 May 1999 08:01:37 +0000 + * From: + * "Ian D. Stewart" + * To: + * Norris Boyd + * References: + * 1 , 2 , 3 , 4 , 5 + * + * + * + * + * Ian D. Stewart wrote: + * + * Norris Boyd wrote: + * + * + * + * + * Can I help with EventListener collector? + * + * Actually, I have a working implementation complete (attatched), but by all means, feel free to add any functionality you feel + * may be missing, or to tweak the code . + * + * Norris, + * + * After I sent I my last e-mail, I noticed some potential issues using Object[] in ListenerCollection.getListeners(Class iface). + * I'm attatching a new version, which uses a Vector object. This should resolve those issues. + * + * + * Ian + * * * KNOWN BUGS/FRUSTRATIONS: * - None, currently. @@ -96,7 +132,9 @@ public class ListenerCollection extends Vector { array.addElement(listener); } } - return array.toArray(); + Object[] result = new Object[array.size()]; + array.copyInto(result); + return result; } } // ListenerCollection diff --git a/mozilla/js/rhino/src/org/mozilla/javascript/ListenerCollection.java b/mozilla/js/rhino/src/org/mozilla/javascript/ListenerCollection.java index b0c74a23cc9..267f5cf93bf 100644 --- a/mozilla/js/rhino/src/org/mozilla/javascript/ListenerCollection.java +++ b/mozilla/js/rhino/src/org/mozilla/javascript/ListenerCollection.java @@ -1,5 +1,5 @@ /** - * $Id: ListenerCollection.java,v 1.1 1999-05-18 22:32:25 norris%netscape.com Exp $ + * $Id: ListenerCollection.java,v 1.2 1999-05-19 23:58:37 norris%netscape.com Exp $ * * This class provides a series of methods for accessing event listeners. * @@ -23,6 +23,42 @@ * * Revision history: * $Log: not supported by cvs2svn $ + * Revision 1.1 1999/05/18 22:32:25 norris%netscape.com + * Add submission: + * Subject: + * Re: Modified Context.java + * Date: + * Sat, 15 May 1999 08:01:37 +0000 + * From: + * "Ian D. Stewart" + * To: + * Norris Boyd + * References: + * 1 , 2 , 3 , 4 , 5 + * + * + * + * + * Ian D. Stewart wrote: + * + * Norris Boyd wrote: + * + * + * + * + * Can I help with EventListener collector? + * + * Actually, I have a working implementation complete (attatched), but by all means, feel free to add any functionality you feel + * may be missing, or to tweak the code . + * + * Norris, + * + * After I sent I my last e-mail, I noticed some potential issues using Object[] in ListenerCollection.getListeners(Class iface). + * I'm attatching a new version, which uses a Vector object. This should resolve those issues. + * + * + * Ian + * * * KNOWN BUGS/FRUSTRATIONS: * - None, currently. @@ -96,7 +132,9 @@ public class ListenerCollection extends Vector { array.addElement(listener); } } - return array.toArray(); + Object[] result = new Object[array.size()]; + array.copyInto(result); + return result; } } // ListenerCollection