diff options
author | Robert Antoni Buj i Gelonch <robert.buj@gmail.com> | 2014-10-11 16:16:09 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2014-10-11 14:51:48 +0000 |
commit | 0bc6ea3637e279fa2807d8ee649fb33f1ae6da47 (patch) | |
tree | b36041b510b6496004b01fbef4f10cd93a68d1e3 /connectivity/qa | |
parent | c51f77b1c02d03a4932d1b20ba6440465d265d48 (diff) |
connectivity: Iterate over each Entry in a Map & Enhanced for-loops
Change-Id: Id4a340584fc727058f6e37c1f0d3c5887e931417
Reviewed-on: https://gerrit.libreoffice.org/11917
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'connectivity/qa')
-rw-r--r-- | connectivity/qa/connectivity/tools/HsqlDatabase.java | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/connectivity/qa/connectivity/tools/HsqlDatabase.java b/connectivity/qa/connectivity/tools/HsqlDatabase.java index b5a7e21f0fbc..13b0f32d24ae 100644 --- a/connectivity/qa/connectivity/tools/HsqlDatabase.java +++ b/connectivity/qa/connectivity/tools/HsqlDatabase.java @@ -30,10 +30,9 @@ import com.sun.star.sdbcx.XTablesSupplier; import com.sun.star.uno.UnoRuntime; import helper.URLHelper; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Set; import java.io.File; +import java.util.HashMap; +import java.util.Map; public class HsqlDatabase extends AbstractDatabase { @@ -162,14 +161,12 @@ public class HsqlDatabase extends AbstractDatabase createStatement.append(')'); } - final Set<String> foreignKeyTables = foreignKeys.keySet(); - for (final Iterator<String> foreignKey = foreignKeyTables.iterator(); - foreignKey.hasNext();) + for (Map.Entry<String, String> foreignKey : foreignKeys.entrySet()) { - final String foreignTable = foreignKey.next(); + final String foreignTable = foreignKey.getKey(); createStatement.append(", FOREIGN KEY ("); - createStatement.append(foreignKeys.get(foreignTable)); + createStatement.append(foreignKey.getValue()); createStatement.append(") REFERENCES \""); createStatement.append(foreignTable); createStatement.append("\"("); |