ICU-5445 Fix JDK 1.5 issues.
X-SVN-Rev: 22442
This commit is contained in:
parent
044ccb368f
commit
5d8c41d2fe
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2000-2004, International Business Machines Corporation and *
|
||||
* Copyright (C) 2000-2007, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
*****************************************************************************
|
||||
*/
|
||||
@ -243,9 +243,9 @@ public class Bundle {
|
||||
removeUntranslatedItemsByGroup(groupName);
|
||||
|
||||
// Loop through all Items
|
||||
Enumeration enum = allItems.elements();
|
||||
while(enum.hasMoreElements()) {
|
||||
BundleItem item = (BundleItem)enum.nextElement();
|
||||
Enumeration elems = allItems.elements();
|
||||
while(elems.hasMoreElements()) {
|
||||
BundleItem item = (BundleItem)elems.nextElement();
|
||||
if (item.getParentGroup().getName().equals(groupName)) {
|
||||
allItems.remove(item);
|
||||
}
|
||||
|
@ -1,14 +1,8 @@
|
||||
/*
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2000-2002, International Business Machines Corporation and *
|
||||
* Copyright (C) 2000-2007, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
*****************************************************************************
|
||||
*
|
||||
* $Source: /xsrl/Nsvn/icu/unicodetools/com/ibm/rbm/BundleItem.java,v $
|
||||
* $Date: 2004/07/14 18:29:00 $
|
||||
* $Revision: 1.4 $
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
package com.ibm.rbm;
|
||||
|
||||
@ -290,9 +284,9 @@ public class BundleItem {
|
||||
}
|
||||
if (creator != null) retStr += " @creator " + creator;
|
||||
if (modifier != null) retStr += " @modifier " + modifier;
|
||||
Enumeration enum = lookups.keys();
|
||||
while (enum.hasMoreElements()) {
|
||||
String str = (String)enum.nextElement();
|
||||
Enumeration elems = lookups.keys();
|
||||
while (elems.hasMoreElements()) {
|
||||
String str = (String)elems.nextElement();
|
||||
retStr += "\n# @{" + str + "} " + (String)lookups.get(str);
|
||||
}
|
||||
if (comment != null) retStr += "\n# @comment " + comment;
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2000-2004, International Business Machines Corporation and *
|
||||
* Copyright (C) 2000-2007, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
*****************************************************************************
|
||||
*/
|
||||
@ -290,7 +290,7 @@ public class RBImporter extends JDialog {
|
||||
progressBar.setValue(0);
|
||||
progressBarDialog.getContentPane().add(progressBar);
|
||||
progressBarDialog.pack();
|
||||
progressBarDialog.show();
|
||||
progressBarDialog.setVisible(true);
|
||||
}
|
||||
|
||||
protected void incrementProgressBar() {
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2000-2004, International Business Machines Corporation and *
|
||||
* Copyright (C) 2000-2007, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
*****************************************************************************
|
||||
*/
|
||||
@ -62,9 +62,9 @@ public class RBJavaImporter extends RBImporter {
|
||||
e.printStackTrace(System.err);
|
||||
}
|
||||
if (base_lrb != null) {
|
||||
Enumeration enum = base_lrb.getKeys();
|
||||
while (enum.hasMoreElements()) {
|
||||
String key = enum.nextElement().toString();
|
||||
Enumeration keys = base_lrb.getKeys();
|
||||
while (keys.hasMoreElements()) {
|
||||
String key = keys.nextElement().toString();
|
||||
RBManagerGUI.debugMsg("Resource -> " + key + " = " + base_lrb.getString(key));
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2000-2004, International Business Machines Corporation and *
|
||||
* Copyright (C) 2000-2007, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
*****************************************************************************
|
||||
*/
|
||||
@ -259,9 +259,9 @@ public class RBManager {
|
||||
|
||||
// Now that we have parsed the entire main language file, populate the allNLSKey set with the dictionary keys
|
||||
allBundleKeys = new Vector();
|
||||
Enumeration enum = ((Bundle)bundles.elementAt(0)).allItems.keys();
|
||||
while (enum.hasMoreElements()) {
|
||||
allBundleKeys.addElement(enum.nextElement());
|
||||
Enumeration keys = ((Bundle)bundles.elementAt(0)).allItems.keys();
|
||||
while (keys.hasMoreElements()) {
|
||||
allBundleKeys.addElement(keys.nextElement());
|
||||
}
|
||||
|
||||
// Now go through all of the other languages
|
||||
@ -323,9 +323,9 @@ public class RBManager {
|
||||
o = descriptors.get("modified"); if (o != null) item.setModifiedDate((String) o);
|
||||
|
||||
// Lookup tags (e.g. {_#_} _description_)
|
||||
Enumeration keys = descriptors.keys();
|
||||
while (keys.hasMoreElements()) {
|
||||
String tag = (String)keys.nextElement();
|
||||
Enumeration descKeys = descriptors.keys();
|
||||
while (descKeys.hasMoreElements()) {
|
||||
String tag = (String)descKeys.nextElement();
|
||||
if (tag.startsWith("{")) {
|
||||
if (tag.indexOf("}") < 0) continue;
|
||||
String lookup = tag.substring(1,tag.indexOf("}"));
|
||||
@ -609,9 +609,9 @@ public class RBManager {
|
||||
bundle.removeUntranslatedItem(itemName);
|
||||
|
||||
// Loop through all Items
|
||||
Enumeration enum = bundle.allItems.elements();
|
||||
while(enum.hasMoreElements()) {
|
||||
BundleItem item = (BundleItem)enum.nextElement();
|
||||
Enumeration items = bundle.allItems.elements();
|
||||
while(items.hasMoreElements()) {
|
||||
BundleItem item = (BundleItem)items.nextElement();
|
||||
if (item.getKey().equals(itemName)) {
|
||||
bundle.allItems.remove(item);
|
||||
item.getParentGroup().removeBundleItem(item.getKey());
|
||||
@ -681,9 +681,9 @@ public class RBManager {
|
||||
item.setModifier(mainItem.getModifier());
|
||||
item.setLookups(new Hashtable());
|
||||
// TODO: This should be done in the Bundle class
|
||||
Enumeration enum = mainItem.getLookups().keys();
|
||||
while (enum.hasMoreElements()) {
|
||||
String name = (String)enum.nextElement();
|
||||
Enumeration keys = mainItem.getLookups().keys();
|
||||
while (keys.hasMoreElements()) {
|
||||
String name = (String)keys.nextElement();
|
||||
String value = (String)mainItem.getLookups().get(name);
|
||||
item.getLookups().put(new String(name), new String(value));
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2000-2004, International Business Machines Corporation and *
|
||||
* Copyright (C) 2000-2007, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
*****************************************************************************
|
||||
*/
|
||||
@ -76,9 +76,9 @@ public class RBPropertiesImporter extends RBImporter {
|
||||
resolveEncodings(encodings);
|
||||
for (int i=0; i < bundles.size(); i++) {
|
||||
Bundle b = (Bundle)bundles.elementAt(i);
|
||||
Enumeration enum = b.allItems.keys();
|
||||
while (enum.hasMoreElements()) {
|
||||
String key = (String)enum.nextElement();
|
||||
Enumeration keys = b.allItems.keys();
|
||||
while (keys.hasMoreElements()) {
|
||||
String key = (String)keys.nextElement();
|
||||
BundleItem item = (BundleItem)b.allItems.get(key);
|
||||
importResource(item, b.encoding, (item.getParentGroup() == null ? getDefaultGroup(): item.getParentGroup().getName()));
|
||||
}
|
||||
@ -105,9 +105,9 @@ public class RBPropertiesImporter extends RBImporter {
|
||||
(children_v.elementAt(i).toString().equals("") ? "" : "_" + children_v.elementAt(i).toString()) +
|
||||
".properties"));
|
||||
p.load(fis);
|
||||
Enumeration enum = p.keys();
|
||||
while (enum.hasMoreElements()) {
|
||||
String key = (String)enum.nextElement();
|
||||
Enumeration keys = p.keys();
|
||||
while (keys.hasMoreElements()) {
|
||||
String key = (String)keys.nextElement();
|
||||
BundleItem item = new BundleItem(null, key, p.getProperty(key));
|
||||
item.setTranslated(this.getDefaultTranslated());
|
||||
importResource(item, children_v.elementAt(i).toString(), getDefaultGroup());
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2000-2004, International Business Machines Corporation and *
|
||||
* Copyright (C) 2000-2007, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
*****************************************************************************
|
||||
*/
|
||||
@ -422,9 +422,9 @@ public class RBReporter extends JFrame {
|
||||
|
||||
int untranslated = 0;
|
||||
String untransStr = new String();
|
||||
Enumeration enum = dict.allItems.elements();
|
||||
while (enum.hasMoreElements()) {
|
||||
BundleItem tempItem = (BundleItem)enum.nextElement();
|
||||
Enumeration items = dict.allItems.elements();
|
||||
while (items.hasMoreElements()) {
|
||||
BundleItem tempItem = (BundleItem)items.nextElement();
|
||||
if (tempItem.isTranslated()) continue;
|
||||
untranslated++;
|
||||
untransStr += " " + tempItem.getKey();
|
||||
@ -512,9 +512,9 @@ public class RBReporter extends JFrame {
|
||||
body_elem.appendChild(block_elem);
|
||||
|
||||
int untranslated = 0;
|
||||
Enumeration enum = dict.allItems.elements();
|
||||
while (enum.hasMoreElements()) {
|
||||
BundleItem tempItem = (BundleItem)enum.nextElement();
|
||||
Enumeration items = dict.allItems.elements();
|
||||
while (items.hasMoreElements()) {
|
||||
BundleItem tempItem = (BundleItem)items.nextElement();
|
||||
if (tempItem.isTranslated()) continue;
|
||||
untranslated++;
|
||||
if (detailed) {
|
||||
@ -542,10 +542,10 @@ public class RBReporter extends JFrame {
|
||||
|
||||
buffer.append("<P>Number of NLS items in the file: " + String.valueOf(dict.allItems.size()) + "</P>\n");
|
||||
int untranslated = 0;
|
||||
Enumeration enum = dict.allItems.elements();
|
||||
Enumeration items = dict.allItems.elements();
|
||||
StringBuffer innerBuffer = new StringBuffer();
|
||||
while (enum.hasMoreElements()) {
|
||||
BundleItem tempItem = (BundleItem)enum.nextElement();
|
||||
while (items.hasMoreElements()) {
|
||||
BundleItem tempItem = (BundleItem)items.nextElement();
|
||||
if (tempItem.isTranslated()) continue;
|
||||
untranslated++;
|
||||
innerBuffer.append("<LI>" + tempItem.getKey() + "</LI>\n");
|
||||
@ -614,9 +614,9 @@ public class RBReporter extends JFrame {
|
||||
if (detailed) lang_report_elem.appendChild(untranslated_elem);
|
||||
|
||||
int untranslated = 0;
|
||||
Enumeration enum = dict.allItems.elements();
|
||||
while (enum.hasMoreElements()) {
|
||||
BundleItem tempItem = (BundleItem)enum.nextElement();
|
||||
Enumeration items = dict.allItems.elements();
|
||||
while (items.hasMoreElements()) {
|
||||
BundleItem tempItem = (BundleItem)items.nextElement();
|
||||
if (tempItem.isTranslated()) continue;
|
||||
untranslated++;
|
||||
Element resource_elem = xml.createElement("RESOURCEKEY");
|
||||
@ -640,10 +640,10 @@ public class RBReporter extends JFrame {
|
||||
|
||||
buffer.append("\t<NLS_TOTAL>" + String.valueOf(dict.allItems.size()) + "</NLS_TOTAL>\n");
|
||||
int untranslated = 0;
|
||||
Enumeration enum = dict.allItems.elements();
|
||||
Enumeration items = dict.allItems.elements();
|
||||
StringBuffer innerBuffer = new StringBuffer();
|
||||
while (enum.hasMoreElements()) {
|
||||
BundleItem tempItem = (BundleItem)enum.nextElement();
|
||||
while (items.hasMoreElements()) {
|
||||
BundleItem tempItem = (BundleItem)items.nextElement();
|
||||
if (tempItem.isTranslated()) continue;
|
||||
untranslated++;
|
||||
innerBuffer.append("\t\t<RESOURCEKEY>" + tempItem.getKey() + "</RESOURCEKEY>\n");
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2000-2004, International Business Machines Corporation and *
|
||||
* Copyright (C) 2000-2007, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
*****************************************************************************
|
||||
*/
|
||||
@ -48,9 +48,9 @@ public class RBReporterScanner {
|
||||
parseRules = getParseRules(root);
|
||||
|
||||
results = new Hashtable();
|
||||
Enumeration enum = bundle.allItems.keys();
|
||||
while (enum.hasMoreElements()) {
|
||||
String key = (String)enum.nextElement();
|
||||
Enumeration keys = bundle.allItems.keys();
|
||||
while (keys.hasMoreElements()) {
|
||||
String key = (String)keys.nextElement();
|
||||
BundleItem item = (BundleItem)bundle.allItems.get(key);
|
||||
results.put(key, new ScanResult(item));
|
||||
}
|
||||
@ -68,26 +68,27 @@ public class RBReporterScanner {
|
||||
|
||||
protected int getNumberUnusedResources() {
|
||||
int count = 0;
|
||||
Enumeration enum = results.elements();
|
||||
while (enum.hasMoreElements()) {
|
||||
ScanResult result = (ScanResult)enum.nextElement();
|
||||
Enumeration elems = results.elements();
|
||||
while (elems.hasMoreElements()) {
|
||||
ScanResult result = (ScanResult)elems.nextElement();
|
||||
if (result.getOccurances().size() < 1) count++;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
protected Vector getMissingResources() {
|
||||
Enumeration enum = missing.elements();
|
||||
Enumeration elems = missing.elements();
|
||||
Vector v = new Vector();
|
||||
while (enum.hasMoreElements()) v.addElement(enum.nextElement());
|
||||
while (elems.hasMoreElements())
|
||||
v.addElement(elems.nextElement());
|
||||
return v;
|
||||
}
|
||||
|
||||
protected Vector getUnusedResources() {
|
||||
Enumeration enum = results.elements();
|
||||
Enumeration elems = results.elements();
|
||||
Vector v = new Vector();
|
||||
while (enum.hasMoreElements()) {
|
||||
ScanResult result = (ScanResult)enum.nextElement();
|
||||
while (elems.hasMoreElements()) {
|
||||
ScanResult result = (ScanResult)elems.nextElement();
|
||||
if (result.getOccurances().size() < 1) {
|
||||
v.addElement(result);
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2000-2004, International Business Machines Corporation and *
|
||||
* Copyright (C) 2000-2007, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
*****************************************************************************
|
||||
*/
|
||||
@ -115,9 +115,9 @@ public class RBTMXExporter extends RBExporter {
|
||||
tuv.appendChild(translated_prop);
|
||||
|
||||
Hashtable lookups = item.getLookups();
|
||||
Enumeration enum = lookups.keys();
|
||||
while (enum.hasMoreElements()) {
|
||||
String key = (String)enum.nextElement();
|
||||
Enumeration keys = lookups.keys();
|
||||
while (keys.hasMoreElements()) {
|
||||
String key = (String)keys.nextElement();
|
||||
String value = (String)lookups.get(key);
|
||||
Element lookup_prop = xml.createElement("prop");
|
||||
lookup_prop.appendChild(xml.createTextNode(key + "=" + value));
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2000-2004, International Business Machines Corporation and *
|
||||
* Copyright (C) 2000-2007, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
*****************************************************************************
|
||||
*/
|
||||
@ -232,9 +232,9 @@ public class RBTMXImporter extends RBImporter {
|
||||
}
|
||||
}
|
||||
Vector v = new Vector();
|
||||
Enumeration enum = hash.keys();
|
||||
while (enum.hasMoreElements()) {
|
||||
v.addElement(enum.nextElement());
|
||||
Enumeration keys = hash.keys();
|
||||
while (keys.hasMoreElements()) {
|
||||
v.addElement(keys.nextElement());
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2000-2004, International Business Machines Corporation and *
|
||||
* Copyright (C) 2000-2007, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
*****************************************************************************
|
||||
*/
|
||||
@ -207,9 +207,9 @@ class BundleItemCreationDialog extends JDialog {
|
||||
}
|
||||
}
|
||||
// Remove old lookups if necessary
|
||||
Enumeration enum = lookups.keys();
|
||||
while (enum.hasMoreElements()) {
|
||||
String name = (String)enum.nextElement();
|
||||
Enumeration keys = lookups.keys();
|
||||
while (keys.hasMoreElements()) {
|
||||
String name = (String)keys.nextElement();
|
||||
if (currentTrans.indexOf("{" + name + "}") < 0) {
|
||||
lookups.remove(name);
|
||||
}
|
||||
@ -235,9 +235,9 @@ class BundleItemCreationDialog extends JDialog {
|
||||
lookupFields = new JTextField[lookups.size()];
|
||||
lookupLabels = new JLabel[lookups.size()];
|
||||
int count = 0;
|
||||
enum = lookups.keys();
|
||||
while (enum.hasMoreElements()) {
|
||||
String name = (String)enum.nextElement();
|
||||
keys = lookups.keys();
|
||||
while (keys.hasMoreElements()) {
|
||||
String name = (String)keys.nextElement();
|
||||
String value = (String)lookups.get(name);
|
||||
RBManagerGUI.debugMsg("Lookup: " + name + " -> " + value);
|
||||
RBManagerGUI.debugMsg(lookups.toString());
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2000-2004, International Business Machines Corporation and *
|
||||
* Copyright (C) 2000-2007, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
*****************************************************************************
|
||||
*/
|
||||
@ -152,9 +152,9 @@ class BundleItemDialog extends JDialog implements ActionListener {
|
||||
lookups = new Box[item.getLookups().size()];
|
||||
lookupLabels = new JLabel[item.getLookups().size()];
|
||||
lookupFields = new JTextField[item.getLookups().size()];
|
||||
Enumeration enum = item.getLookups().keys();
|
||||
Enumeration keys = item.getLookups().keys();
|
||||
for (int i = 0; i < item.getLookups().size(); i++) {
|
||||
String name = (String)enum.nextElement();
|
||||
String name = (String)keys.nextElement();
|
||||
String value = (String)item.getLookups().get(name);
|
||||
RBManagerGUI.debugMsg("X - Lookup: " + name + " -> " + value);
|
||||
lookups[i] = new Box(BoxLayout.X_AXIS);
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2000-2004, International Business Machines Corporation and *
|
||||
* Copyright (C) 2000-2007, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
*****************************************************************************
|
||||
*/
|
||||
@ -90,9 +90,9 @@ class RBSearchPanel extends JPanel {
|
||||
|
||||
private void performSearch(String term, Bundle bundle, boolean case_sensitive) {
|
||||
Vector ret_v = new Vector();
|
||||
Enumeration enum = bundle.allItems.keys();
|
||||
while (enum.hasMoreElements()) {
|
||||
String key = (String)enum.nextElement();
|
||||
Enumeration keys = bundle.allItems.keys();
|
||||
while (keys.hasMoreElements()) {
|
||||
String key = (String)keys.nextElement();
|
||||
BundleItem item = (BundleItem)bundle.allItems.get(key);
|
||||
if (case_sensitive) {
|
||||
if (keysCheck.isSelected() && key.indexOf(term) >= 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user