108 |
* |
* |
109 |
* @return an enumeration of the keys |
* @return an enumeration of the keys |
110 |
*/ |
*/ |
111 |
public Enumeration getKeys() |
public Enumeration<String> getKeys() |
112 |
{ |
{ |
113 |
// We make a new Set that holds all the keys, then return an enumeration |
// We make a new Set that holds all the keys, then return an enumeration |
114 |
// for that. This prevents modifications from ruining the enumeration, |
// for that. This prevents modifications from ruining the enumeration, |
115 |
// as well as ignoring duplicates. |
// as well as ignoring duplicates. |
116 |
final Object[][] contents = getContents(); |
final Object[][] contents = getContents(); |
117 |
Set s = new HashSet(); |
Set<String> s = new HashSet<String>(); |
118 |
int i = contents.length; |
int i = contents.length; |
119 |
while (--i >= 0) |
while (--i >= 0) |
120 |
s.add(contents[i][0]); |
s.add((String) contents[i][0]); |
121 |
ResourceBundle bundle = parent; |
ResourceBundle bundle = parent; |
122 |
// Eliminate tail recursion. |
// Eliminate tail recursion. |
123 |
while (bundle != null) |
while (bundle != null) |
124 |
{ |
{ |
125 |
Enumeration e = bundle.getKeys(); |
Enumeration<String> e = bundle.getKeys(); |
126 |
while (e.hasMoreElements()) |
while (e.hasMoreElements()) |
127 |
s.add(e.nextElement()); |
s.add(e.nextElement()); |
128 |
bundle = bundle.parent; |
bundle = bundle.parent; |