< prev index next >

src/com/sun/interview/PropertiesQuestion.java

Print this page
rev 145 : 7902237: Fixing raw use of parameterized class
Reviewed-by: jjg

*** 154,164 **** * Get the set of keys currently used this question. Includes all hidden and * read-only values as well. * @return The set of keys (internal non-i18n value) * @see #setKeys */ ! public Enumeration getKeys() { if (value != null) return value.keys(); else return null; } --- 154,164 ---- * Get the set of keys currently used this question. Includes all hidden and * read-only values as well. * @return The set of keys (internal non-i18n value) * @see #setKeys */ ! public Enumeration<?> getKeys() { if (value != null) return value.keys(); else return null; }
*** 214,228 **** public String getStringValue() { StringBuffer result = new StringBuffer(); if (value != null) { String sep = System.getProperty("line.separator"); ! Enumeration names = value.propertyNames(); ! ArrayList list = Collections.list(names); ! Collections.sort(list); ! for (Object o : list) { ! String key = (String)o; result.append(key); result.append("="); result.append(value.getProperty(key)); result.append(sep); } --- 214,225 ---- public String getStringValue() { StringBuffer result = new StringBuffer(); if (value != null) { String sep = System.getProperty("line.separator"); ! SortedSet<String> names = new TreeSet<>(value.stringPropertyNames()); ! for (String key : names) { result.append(key); result.append("="); result.append(value.getProperty(key)); result.append(sep); }
*** 318,328 **** } // repopulate a J2SE properties object Properties p = new Properties(); ! Enumeration e = p2.propertyNames(); while(e.hasMoreElements()) { Object next = e.nextElement(); p.put( next, p2.get(next) ); } // while --- 315,325 ---- } // repopulate a J2SE properties object Properties p = new Properties(); ! Enumeration<?> e = p2.propertyNames(); while(e.hasMoreElements()) { Object next = e.nextElement(); p.put( next, p2.get(next) ); } // while
*** 409,419 **** * by this base implementation. * @return Invalid key in index zero, <em>localized</em> explanation * in index one. Null means there are no invalid keys. */ public String[][] getInvalidKeys() { ! Enumeration names = value.propertyNames(); List<String> badKeys = new ArrayList<>(); List<String> reasons = new ArrayList<>(); while (names.hasMoreElements()) { String curr = (String)(names.nextElement()); --- 406,416 ---- * by this base implementation. * @return Invalid key in index zero, <em>localized</em> explanation * in index one. Null means there are no invalid keys. */ public String[][] getInvalidKeys() { ! Enumeration<?> names = value.propertyNames(); List<String> badKeys = new ArrayList<>(); List<String> reasons = new ArrayList<>(); while (names.hasMoreElements()) { String curr = (String)(names.nextElement());
*** 688,698 **** public String[][] getUngrouped() { if (value == null || value.size() == 0) return null; if (keyGroups != null) { ! Set keys = keyGroups.keySet(); if (keys != null) { String[] gps = getGroups(); Properties copy = (Properties)(value.clone()); // remove all grouped entries from the copied --- 685,695 ---- public String[][] getUngrouped() { if (value == null || value.size() == 0) return null; if (keyGroups != null) { ! Set<String> keys = keyGroups.keySet(); if (keys != null) { String[] gps = getGroups(); Properties copy = (Properties)(value.clone()); // remove all grouped entries from the copied
*** 703,718 **** for (int j = 0; j < vals.length; j++) copy.remove(vals[j][0]); } if (copy.size() > 0) { ! Enumeration en = copy.propertyNames(); String[][] ret = new String[copy.size()][2]; int i = 0; ! ! while (en.hasMoreElements()) { ! String key = (String)(en.nextElement()); ret[i][0] = key; ret[i][1] = copy.getProperty(key); i++; } // while --- 700,713 ---- for (int j = 0; j < vals.length; j++) copy.remove(vals[j][0]); } if (copy.size() > 0) { ! Set<String> en = copy.stringPropertyNames(); String[][] ret = new String[copy.size()][2]; int i = 0; ! for (String key : en) { ret[i][0] = key; ret[i][1] = copy.getProperty(key); i++; } // while
*** 722,732 **** return null; } } // no groups, return the entire value set String[][] ret = new String[value.size()][2]; ! Enumeration en = value.propertyNames(); int i = 0; while (en.hasMoreElements()) { String key = (String)(en.nextElement()); ret[i][0] = key; --- 717,727 ---- return null; } } // no groups, return the entire value set String[][] ret = new String[value.size()][2]; ! Enumeration<?> en = value.propertyNames(); int i = 0; while (en.hasMoreElements()) { String key = (String)(en.nextElement()); ret[i][0] = key;
< prev index next >