--- a/jdk/src/share/classes/java/awt/CardLayout.java Mon Sep 02 14:06:24 2013 +0400
+++ b/jdk/src/share/classes/java/awt/CardLayout.java Mon Sep 02 16:48:51 2013 +0400
@@ -66,7 +66,7 @@
* pairs of components and their names.
* @see java.util.Vector
*/
- Vector vector = new Vector();
+ Vector<Card> vector = new Vector<>();
/*
* A pair of Component and String that represents its name.
@@ -570,10 +570,10 @@
if (f.defaulted("vector")) {
// pre-1.4 stream
- Hashtable tab = (Hashtable)f.get("tab", null);
- vector = new Vector();
+ Hashtable<String, Component> tab = (Hashtable)f.get("tab", null);
+ vector = new Vector<>();
if (tab != null && !tab.isEmpty()) {
- for (Enumeration e = tab.keys() ; e.hasMoreElements() ; ) {
+ for (Enumeration<String> e = tab.keys() ; e.hasMoreElements() ; ) {
String key = (String)e.nextElement();
Component comp = (Component)tab.get(key);
vector.add(new Card(key, comp));
@@ -594,7 +594,7 @@
private void writeObject(ObjectOutputStream s)
throws IOException
{
- Hashtable tab = new Hashtable();
+ Hashtable<String, Component> tab = new Hashtable<>();
int ncomponents = vector.size();
for (int i = 0; i < ncomponents; i++) {
Card card = (Card)vector.get(i);