Changes all uses of Vector to ArrayList in the user, samples and super. Review by: scottb git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@1109 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/samples/mail/src/com/google/gwt/sample/mail/client/MailItems.java b/samples/mail/src/com/google/gwt/sample/mail/client/MailItems.java index e38a8f0..0ff4c8f 100644 --- a/samples/mail/src/com/google/gwt/sample/mail/client/MailItems.java +++ b/samples/mail/src/com/google/gwt/sample/mail/client/MailItems.java
@@ -15,7 +15,7 @@ */ package com.google.gwt.sample.mail.client; -import java.util.Vector; +import java.util.ArrayList; /** * A simple client-side generator of fake email messages. @@ -215,7 +215,7 @@ private static int senderIdx = 0, emailIdx = 0, subjectIdx = 0, fragmentIdx = 0; - private static Vector items = new Vector(); + private static ArrayList items = new ArrayList(); static { for (int i = 0; i < NUM_ITEMS; ++i) {
diff --git a/user/src/com/google/gwt/user/client/DOM.java b/user/src/com/google/gwt/user/client/DOM.java index 1e01ddb..e518552 100644 --- a/user/src/com/google/gwt/user/client/DOM.java +++ b/user/src/com/google/gwt/user/client/DOM.java
@@ -19,7 +19,7 @@ import com.google.gwt.core.client.GWT.UncaughtExceptionHandler; import com.google.gwt.user.client.impl.DOMImpl; -import java.util.Vector; +import java.util.ArrayList; /** * This class provides a set of static methods that allow you to manipulate the @@ -33,7 +33,7 @@ private static Element sCaptureElem; //<BrowserEventPreview> - private static Vector sEventPreviewStack = new Vector(); + private static ArrayList sEventPreviewStack = new ArrayList(); static { impl = (DOMImpl) GWT.create(DOMImpl.class);
diff --git a/user/src/com/google/gwt/user/client/History.java b/user/src/com/google/gwt/user/client/History.java index ff1a82b..621b00f 100644 --- a/user/src/com/google/gwt/user/client/History.java +++ b/user/src/com/google/gwt/user/client/History.java
@@ -1,5 +1,5 @@ /* - * Copyright 2006 Google Inc. + * Copyright 2007 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -19,8 +19,8 @@ import com.google.gwt.core.client.GWT.UncaughtExceptionHandler; import com.google.gwt.user.client.impl.HistoryImpl; +import java.util.ArrayList; import java.util.Iterator; -import java.util.Vector; /** * This class allows you to interact with the browser's history stack. Each @@ -43,7 +43,7 @@ */ public class History { - private static Vector historyListeners = new Vector(); + private static ArrayList historyListeners = new ArrayList(); private static HistoryImpl impl; static {
diff --git a/user/src/com/google/gwt/user/client/Window.java b/user/src/com/google/gwt/user/client/Window.java index 6b2adec..c3db24b 100644 --- a/user/src/com/google/gwt/user/client/Window.java +++ b/user/src/com/google/gwt/user/client/Window.java
@@ -1,5 +1,5 @@ /* - * Copyright 2006 Google Inc. + * Copyright 2007 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -18,8 +18,8 @@ import com.google.gwt.core.client.GWT; import com.google.gwt.core.client.GWT.UncaughtExceptionHandler; +import java.util.ArrayList; import java.util.Iterator; -import java.util.Vector; /** * This class provides access to the browser window's methods, properties, and @@ -27,8 +27,8 @@ */ public class Window { - private static Vector closingListeners = new Vector(); - private static Vector resizeListeners = new Vector(); + private static ArrayList closingListeners = new ArrayList(); + private static ArrayList resizeListeners = new ArrayList(); static { init();
diff --git a/user/src/com/google/gwt/user/client/ui/ChangeListenerCollection.java b/user/src/com/google/gwt/user/client/ui/ChangeListenerCollection.java index 502b880..068e854 100644 --- a/user/src/com/google/gwt/user/client/ui/ChangeListenerCollection.java +++ b/user/src/com/google/gwt/user/client/ui/ChangeListenerCollection.java
@@ -1,5 +1,5 @@ /* - * Copyright 2006 Google Inc. + * Copyright 2007 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -15,15 +15,15 @@ */ package com.google.gwt.user.client.ui; +import java.util.ArrayList; import java.util.Iterator; -import java.util.Vector; /** * A helper class for implementers of the SourcesChangeEvents interface. This - * subclass of Vector assumes that all objects added to it will be of type - * {@link com.google.gwt.user.client.ui.ChangeListener}. + * subclass of {@linkArrayList} assumes that all objects added to it will be of + * type {@link com.google.gwt.user.client.ui.ChangeListener}. */ -public class ChangeListenerCollection extends Vector { +public class ChangeListenerCollection extends ArrayList { /** * Fires a change event to all listeners.
diff --git a/user/src/com/google/gwt/user/client/ui/ClickListenerCollection.java b/user/src/com/google/gwt/user/client/ui/ClickListenerCollection.java index 2351287..f7a3203 100644 --- a/user/src/com/google/gwt/user/client/ui/ClickListenerCollection.java +++ b/user/src/com/google/gwt/user/client/ui/ClickListenerCollection.java
@@ -1,5 +1,5 @@ /* - * Copyright 2006 Google Inc. + * Copyright 2007 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -15,15 +15,15 @@ */ package com.google.gwt.user.client.ui; +import java.util.ArrayList; import java.util.Iterator; -import java.util.Vector; /** * A helper class for implementers of the SourcesClickEvents interface. This - * subclass of Vector assumes that all objects added to it will be of type - * {@link com.google.gwt.user.client.ui.ClickListener}. + * subclass of {@linkArrayList} assumes that all objects added to it will be of + * type {@link com.google.gwt.user.client.ui.ClickListener}. */ -public class ClickListenerCollection extends Vector { +public class ClickListenerCollection extends ArrayList { /** * Fires a click event to all listeners.
diff --git a/user/src/com/google/gwt/user/client/ui/FocusListenerCollection.java b/user/src/com/google/gwt/user/client/ui/FocusListenerCollection.java index f250533..14504b1 100644 --- a/user/src/com/google/gwt/user/client/ui/FocusListenerCollection.java +++ b/user/src/com/google/gwt/user/client/ui/FocusListenerCollection.java
@@ -1,5 +1,5 @@ /* - * Copyright 2006 Google Inc. + * Copyright 2007 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -18,16 +18,16 @@ import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.Event; +import java.util.ArrayList; import java.util.Iterator; -import java.util.Vector; /** * A helper class for implementers of the * {@link com.google.gwt.user.client.ui.SourcesFocusEvents} interface. This - * subclass of Vector assumes that all objects added to it will be of type - * {@link com.google.gwt.user.client.ui.FocusListener}. + * subclass of {@linkArrayList} assumes that all objects added to it will be of + * type {@link com.google.gwt.user.client.ui.FocusListener}. */ -public class FocusListenerCollection extends Vector { +public class FocusListenerCollection extends ArrayList { /** * Fires a focus event to all listeners.
diff --git a/user/src/com/google/gwt/user/client/ui/KeyboardListenerCollection.java b/user/src/com/google/gwt/user/client/ui/KeyboardListenerCollection.java index 751e4f2..fd0c17a 100644 --- a/user/src/com/google/gwt/user/client/ui/KeyboardListenerCollection.java +++ b/user/src/com/google/gwt/user/client/ui/KeyboardListenerCollection.java
@@ -1,5 +1,5 @@ /* - * Copyright 2006 Google Inc. + * Copyright 2007 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -18,15 +18,15 @@ import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.Event; +import java.util.ArrayList; import java.util.Iterator; -import java.util.Vector; /** * A helper class for implementers of the SourcesKeyboardEvents interface. This - * subclass of Vector assumes that all objects added to it will be of type - * {@link com.google.gwt.user.client.ui.KeyboardListener}. + * subclass of {@linkArrayList} assumes that all objects added to it will be of + * type {@link com.google.gwt.user.client.ui.KeyboardListener}. */ -public class KeyboardListenerCollection extends Vector { +public class KeyboardListenerCollection extends ArrayList { /** * Gets the keyboard modifiers associated with a DOMEvent.
diff --git a/user/src/com/google/gwt/user/client/ui/LoadListenerCollection.java b/user/src/com/google/gwt/user/client/ui/LoadListenerCollection.java index 69add24..bf1d562 100644 --- a/user/src/com/google/gwt/user/client/ui/LoadListenerCollection.java +++ b/user/src/com/google/gwt/user/client/ui/LoadListenerCollection.java
@@ -1,5 +1,5 @@ /* - * Copyright 2006 Google Inc. + * Copyright 2007 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -15,15 +15,15 @@ */ package com.google.gwt.user.client.ui; +import java.util.ArrayList; import java.util.Iterator; -import java.util.Vector; /** * A helper class for implementers of the SourcesLoadEvents interface. This - * subclass of Vector assumes that all objects added to it will be of type - * {@link com.google.gwt.user.client.ui.LoadListener}. + * subclass of {@linkArrayList} assumes that all objects added to it will be of + * type {@link com.google.gwt.user.client.ui.LoadListener}. */ -public class LoadListenerCollection extends Vector { +public class LoadListenerCollection extends ArrayList { /** * Fires an error event to all listeners.
diff --git a/user/src/com/google/gwt/user/client/ui/MenuBar.java b/user/src/com/google/gwt/user/client/ui/MenuBar.java index 60de7e7..266d67d 100644 --- a/user/src/com/google/gwt/user/client/ui/MenuBar.java +++ b/user/src/com/google/gwt/user/client/ui/MenuBar.java
@@ -1,5 +1,5 @@ /* - * Copyright 2006 Google Inc. + * Copyright 2007 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -21,7 +21,7 @@ import com.google.gwt.user.client.Element; import com.google.gwt.user.client.Event; -import java.util.Vector; +import java.util.ArrayList; /** * A standard menu bar widget. A menu bar can contain any number of menu items, @@ -47,7 +47,7 @@ public class MenuBar extends Widget implements PopupListener { private Element body; - private Vector items = new Vector(); + private ArrayList items = new ArrayList(); private MenuBar parentMenu; private PopupPanel popup; private MenuItem selectedItem;
diff --git a/user/src/com/google/gwt/user/client/ui/MouseListenerCollection.java b/user/src/com/google/gwt/user/client/ui/MouseListenerCollection.java index 044ace3..575d0c7 100644 --- a/user/src/com/google/gwt/user/client/ui/MouseListenerCollection.java +++ b/user/src/com/google/gwt/user/client/ui/MouseListenerCollection.java
@@ -20,15 +20,15 @@ import com.google.gwt.user.client.Event; import com.google.gwt.user.client.Window; +import java.util.ArrayList; import java.util.Iterator; -import java.util.Vector; /** * A helper class for implementers of the SourcesMouseEvents interface. This - * subclass of Vector assumes that all objects added to it will be of type - * {@link com.google.gwt.user.client.ui.MouseListener}. + * subclass of {@linkArrayList} assumes that all objects added to it will be of + * type {@link com.google.gwt.user.client.ui.MouseListener}. */ -public class MouseListenerCollection extends Vector { +public class MouseListenerCollection extends ArrayList { /** * Fires a mouse down event to all listeners.
diff --git a/user/src/com/google/gwt/user/client/ui/MouseWheelListenerCollection.java b/user/src/com/google/gwt/user/client/ui/MouseWheelListenerCollection.java index e487a08..cdcce34 100644 --- a/user/src/com/google/gwt/user/client/ui/MouseWheelListenerCollection.java +++ b/user/src/com/google/gwt/user/client/ui/MouseWheelListenerCollection.java
@@ -1,12 +1,12 @@ /* * Copyright 2007 Google Inc. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -18,15 +18,15 @@ import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.Event; +import java.util.ArrayList; import java.util.Iterator; -import java.util.Vector; /** * A helper class for implementers of the SourcesMouseWheelEvents interface. - * This subclass of Vector assumes that all objects added to it will be of type - * {@link com.google.gwt.user.client.ui.MouseWheelListener}. + * This subclass of {@linkArrayList} assumes that all objects added to it will + * be of type {@link com.google.gwt.user.client.ui.MouseWheelListener}. */ -public class MouseWheelListenerCollection extends Vector { +public class MouseWheelListenerCollection extends ArrayList { /** * Fires a mouse wheel event to all listeners.
diff --git a/user/src/com/google/gwt/user/client/ui/PopupListenerCollection.java b/user/src/com/google/gwt/user/client/ui/PopupListenerCollection.java index 4b30f86..317b382 100644 --- a/user/src/com/google/gwt/user/client/ui/PopupListenerCollection.java +++ b/user/src/com/google/gwt/user/client/ui/PopupListenerCollection.java
@@ -1,5 +1,5 @@ /* - * Copyright 2006 Google Inc. + * Copyright 2007 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -15,15 +15,15 @@ */ package com.google.gwt.user.client.ui; +import java.util.ArrayList; import java.util.Iterator; -import java.util.Vector; /** * A helper class for implementers of the SourcesPopupEvents interface. This - * subclass of Vector assumes that all objects added to it will be of type - * {@link com.google.gwt.user.client.ui.PopupListener}. + * subclass of {@linkArrayList} assumes that all objects added to it will be of + * type {@link com.google.gwt.user.client.ui.PopupListener}. */ -public class PopupListenerCollection extends Vector { +public class PopupListenerCollection extends ArrayList { /** * Fires a popup closed event to all listeners.
diff --git a/user/src/com/google/gwt/user/client/ui/ScrollListenerCollection.java b/user/src/com/google/gwt/user/client/ui/ScrollListenerCollection.java index 85705b8..477f911 100644 --- a/user/src/com/google/gwt/user/client/ui/ScrollListenerCollection.java +++ b/user/src/com/google/gwt/user/client/ui/ScrollListenerCollection.java
@@ -1,5 +1,5 @@ /* - * Copyright 2006 Google Inc. + * Copyright 2007 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -15,15 +15,15 @@ */ package com.google.gwt.user.client.ui; +import java.util.ArrayList; import java.util.Iterator; -import java.util.Vector; /** * A helper class for implementers of the SourcesScrollEvents interface. This - * subclass of Vector assumes that all objects added to it will be of type - * {@link com.google.gwt.user.client.ui.ScrollListener}. + * subclass of {@linkArrayList} assumes that all objects added to it will be of + * type {@link com.google.gwt.user.client.ui.ScrollListener}. */ -public class ScrollListenerCollection extends Vector { +public class ScrollListenerCollection extends ArrayList { /** * Fires a scroll event to all listeners.
diff --git a/user/src/com/google/gwt/user/client/ui/TabListenerCollection.java b/user/src/com/google/gwt/user/client/ui/TabListenerCollection.java index 1500dbe..a62a730 100644 --- a/user/src/com/google/gwt/user/client/ui/TabListenerCollection.java +++ b/user/src/com/google/gwt/user/client/ui/TabListenerCollection.java
@@ -1,5 +1,5 @@ /* - * Copyright 2006 Google Inc. + * Copyright 2007 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -15,16 +15,16 @@ */ package com.google.gwt.user.client.ui; +import java.util.ArrayList; import java.util.Iterator; -import java.util.Vector; /** * A helper class for implementers of the * {@link com.google.gwt.user.client.ui.SourcesTabEvents} interface. This - * subclass of Vector assumes that all objects added to it will be of type - * {@link com.google.gwt.user.client.ui.TabListener}. + * subclass of {@linkArrayList} assumes that all objects added to it will be of + * type {@link com.google.gwt.user.client.ui.TabListener}. */ -public class TabListenerCollection extends Vector { +public class TabListenerCollection extends ArrayList { /** * Fires a beforeTabSelected event to all listeners.
diff --git a/user/src/com/google/gwt/user/client/ui/TableListenerCollection.java b/user/src/com/google/gwt/user/client/ui/TableListenerCollection.java index 84442f3..07ca56f 100644 --- a/user/src/com/google/gwt/user/client/ui/TableListenerCollection.java +++ b/user/src/com/google/gwt/user/client/ui/TableListenerCollection.java
@@ -1,5 +1,5 @@ /* - * Copyright 2006 Google Inc. + * Copyright 2007 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -15,16 +15,16 @@ */ package com.google.gwt.user.client.ui; +import java.util.ArrayList; import java.util.Iterator; -import java.util.Vector; /** * A helper class for implementers of the * {@link com.google.gwt.user.client.ui.SourcesTableEvents} interface. This - * subclass of Vector assumes that all objects added to it will be of type - * {@link com.google.gwt.user.client.ui.TableListener}. + * subclass of {@linkArrayList} assumes that all objects added to it will be of + * type {@link com.google.gwt.user.client.ui.TableListener}. */ -public class TableListenerCollection extends Vector { +public class TableListenerCollection extends ArrayList { /** * Fires a cellClicked event to all listeners.
diff --git a/user/src/com/google/gwt/user/client/ui/Tree.java b/user/src/com/google/gwt/user/client/ui/Tree.java index 77bdc5c..74acaa6 100644 --- a/user/src/com/google/gwt/user/client/ui/Tree.java +++ b/user/src/com/google/gwt/user/client/ui/Tree.java
@@ -25,7 +25,6 @@ import java.util.Iterator; import java.util.List; import java.util.Set; -import java.util.Vector; /** * A standard hierarchical tree widget. The tree contains a hierarchy of @@ -463,7 +462,7 @@ // If we got here because of a key tab, then we need to make sure the // current tree item is selected. if (DOM.eventGetKeyCode(event) == KeyboardListener.KEY_TAB) { - Vector chain = new Vector(); + ArrayList chain = new ArrayList(); collectElementChain(chain, getElement(), DOM.eventGetTarget(event)); TreeItem item = findItemByChain(chain, 0, root); if (item != getSelectedItem()) { @@ -670,7 +669,7 @@ /** * Collects parents going up the element tree, terminated at the tree root. */ - private void collectElementChain(Vector chain, Element hRoot, Element hElem) { + private void collectElementChain(ArrayList chain, Element hRoot, Element hElem) { if ((hElem == null) || DOM.compare(hElem, hRoot)) { return; } @@ -680,7 +679,7 @@ } private boolean elementClicked(TreeItem root, Element hElem) { - Vector chain = new Vector(); + ArrayList chain = new ArrayList(); collectElementChain(chain, getElement(), hElem); TreeItem item = findItemByChain(chain, 0, root); @@ -704,7 +703,7 @@ return findDeepestOpenChild(item.getChild(item.getChildCount() - 1)); } - private TreeItem findItemByChain(Vector chain, int idx, TreeItem root) { + private TreeItem findItemByChain(ArrayList chain, int idx, TreeItem root) { if (idx == chain.size()) { return root; }
diff --git a/user/src/com/google/gwt/user/client/ui/TreeListenerCollection.java b/user/src/com/google/gwt/user/client/ui/TreeListenerCollection.java index 9e9192b..f6314e6 100644 --- a/user/src/com/google/gwt/user/client/ui/TreeListenerCollection.java +++ b/user/src/com/google/gwt/user/client/ui/TreeListenerCollection.java
@@ -1,5 +1,5 @@ /* - * Copyright 2006 Google Inc. + * Copyright 2007 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -15,15 +15,15 @@ */ package com.google.gwt.user.client.ui; +import java.util.ArrayList; import java.util.Iterator; -import java.util.Vector; /** * A helper class for implementers of the SourcesClickEvents interface. This - * subclass of Vector assumes that all objects added to it will be of type - * {@link com.google.gwt.user.client.ui.ClickListener}. + * subclass of {@linkArrayList} assumes that all objects added to it will be of + * type {@link com.google.gwt.user.client.ui.ClickListener}. */ -public class TreeListenerCollection extends Vector { +public class TreeListenerCollection extends ArrayList { /** * Fires a "tree item selected" event to all listeners.
diff --git a/user/super/com/google/gwt/emul/java/util/HashMap.java b/user/super/com/google/gwt/emul/java/util/HashMap.java index 1af347b..a5995f0 100644 --- a/user/super/com/google/gwt/emul/java/util/HashMap.java +++ b/user/super/com/google/gwt/emul/java/util/HashMap.java
@@ -1,5 +1,5 @@ /* - * Copyright 2006 Google Inc. + * Copyright 2007 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -425,7 +425,7 @@ } public Collection values() { - List values = new Vector(); + List values = new ArrayList(); addAllValuesFromJavascriptObject(values, map); return values; }