< prev index next >
src/com/sun/interview/Properties2.java
Print this page
rev 145 : 7902237: Fixing raw use of parameterized class
Reviewed-by: jjg
*** 69,79 ****
public Properties2(Properties2 defaults) {
this.defaults = defaults;
}
public void load(java.util.Properties source) {
! Enumeration e = source.propertyNames();
while(e.hasMoreElements()) {
Object next = e.nextElement();
put( ((String)next), source.get(next) );
} // while
}
--- 69,79 ----
public Properties2(Properties2 defaults) {
this.defaults = defaults;
}
public void load(java.util.Properties source) {
! Enumeration<?> e = source.propertyNames();
while(e.hasMoreElements()) {
Object next = e.nextElement();
put( ((String)next), source.get(next) );
} // while
}
*** 201,212 ****
prnt.println(header);
}
prnt.write('#');
prnt.println(new Date());
! for (Enumeration e = keys() ; e.hasMoreElements() ;) {
! String key = (String)e.nextElement();
prnt.print(key);
prnt.write('=');
String val = (String)get(key);
int len = val.length();
--- 201,212 ----
prnt.println(header);
}
prnt.write('#');
prnt.println(new Date());
! for (Enumeration<String> e = keys() ; e.hasMoreElements() ;) {
! String key = e.nextElement();
prnt.print(key);
prnt.write('=');
String val = (String)get(key);
int len = val.length();
*** 283,293 ****
* @return an enumeration of all the keys in this property list, including
* the keys in the default property list.
* @see java.util.Enumeration
* @see com.sun.interview.Properties2#defaults
*/
! public Enumeration propertyNames() {
Hashtable<String, Object> h = new Hashtable<>();
enumerate(h);
return h.keys();
}
--- 283,293 ----
* @return an enumeration of all the keys in this property list, including
* the keys in the default property list.
* @see java.util.Enumeration
* @see com.sun.interview.Properties2#defaults
*/
! public Enumeration<String> propertyNames() {
Hashtable<String, Object> h = new Hashtable<>();
enumerate(h);
return h.keys();
}
*** 305,316 ****
*/
public void list(PrintWriter out) {
out.println("-- listing properties --");
Hashtable<String, Object> h = new Hashtable<>();
enumerate(h);
! for (Enumeration e = h.keys() ; e.hasMoreElements() ;) {
! String key = (String)e.nextElement();
String val = (String)h.get(key);
if (val.length() > 40) {
val = val.substring(0, 37) + "...";
}
out.println(key + "=" + val);
--- 305,316 ----
*/
public void list(PrintWriter out) {
out.println("-- listing properties --");
Hashtable<String, Object> h = new Hashtable<>();
enumerate(h);
! for (Enumeration<String> e = h.keys() ; e.hasMoreElements() ;) {
! String key = e.nextElement();
String val = (String)h.get(key);
if (val.length() > 40) {
val = val.substring(0, 37) + "...";
}
out.println(key + "=" + val);
*** 323,334 ****
*/
private synchronized void enumerate(Hashtable<String, Object> h) {
if (defaults != null) {
defaults.enumerate(h);
}
! for (Enumeration e = keys() ; e.hasMoreElements() ;) {
! String key = (String)e.nextElement();
h.put(key, get(key));
}
}
/**
--- 323,334 ----
*/
private synchronized void enumerate(Hashtable<String, Object> h) {
if (defaults != null) {
defaults.enumerate(h);
}
! for (Enumeration<String> e = keys() ; e.hasMoreElements() ;) {
! String key = e.nextElement();
h.put(key, get(key));
}
}
/**
< prev index next >