--- a/jdk/src/share/classes/java/awt/MenuBar.java Wed Mar 06 19:42:26 2013 +0400
+++ b/jdk/src/share/classes/java/awt/MenuBar.java Wed Mar 06 20:10:04 2013 +0400
@@ -81,7 +81,7 @@
return menuBar.helpMenu;
}
- public Vector getMenus(MenuBar menuBar) {
+ public Vector<Menu> getMenus(MenuBar menuBar) {
return menuBar.menus;
}
});
@@ -94,7 +94,7 @@
* @serial
* @see #countMenus()
*/
- Vector menus = new Vector();
+ Vector<Menu> menus = new Vector<>();
/**
* This menu is a special menu dedicated to
@@ -309,7 +309,7 @@
* be called on the toolkit thread.
*/
final Menu getMenuImpl(int i) {
- return (Menu)menus.elementAt(i);
+ return menus.elementAt(i);
}
/**
@@ -321,10 +321,10 @@
* @since JDK1.1
*/
public synchronized Enumeration<MenuShortcut> shortcuts() {
- Vector shortcuts = new Vector();
+ Vector<MenuShortcut> shortcuts = new Vector<>();
int nmenus = getMenuCount();
for (int i = 0 ; i < nmenus ; i++) {
- Enumeration e = getMenu(i).shortcuts();
+ Enumeration<MenuShortcut> e = getMenu(i).shortcuts();
while (e.hasMoreElements()) {
shortcuts.addElement(e.nextElement());
}
@@ -438,7 +438,7 @@
// HeadlessException will be thrown from MenuComponent's readObject
s.defaultReadObject();
for (int i = 0; i < menus.size(); i++) {
- Menu m = (Menu)menus.elementAt(i);
+ Menu m = menus.elementAt(i);
m.parent = this;
}
}