diff options
author | Carsten Hammer | 2019-09-25 20:04:49 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2019-10-27 09:12:49 +0000 |
commit | 6862bac5b2c881540e8ee99020975a89cb997684 (patch) | |
tree | f329286fab97aeb4cc57d418ae3d310f0b9e6611 /bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug302580.java | |
parent | 3d0b351e0d3f340bcc26f7a651f4eebfc817b722 (diff) | |
download | rt.equinox.p2-6862bac5b2c881540e8ee99020975a89cb997684.tar.gz rt.equinox.p2-6862bac5b2c881540e8ee99020975a89cb997684.tar.xz rt.equinox.p2-6862bac5b2c881540e8ee99020975a89cb997684.zip |
Use jdk 5 for-each loopY20191112-0030Y20191107-0440Y20191107-0420I20191114-0410I20191113-2315I20191113-1800I20191112-1800I20191111-1800I20191111-0920I20191111-0655I20191111-0435I20191111-0145I20191110-1800I20191109-1800I20191109-0650I20191109-0330I20191108-1800I20191107-1800I20191106-1805I20191105-1800I20191105-0025I20191104-1800I20191103-1800I20191102-1800I20191101-1800I20191101-0300I20191031-1800I20191031-1325I20191030-1800I20191030-0010I20191029-1800I20191028-1800I20191027-1800
Replace simple uses of Iterator with a corresponding for-loop. Also add
missing braces on loops as necessary.
toString() on array
toString() implementation for arrays does not convert array contents to
String, rather it will print array's type and hash code (defined as
identity hash code). To get string representation of contents of the
array, the array could be for example wrapped into Arrays.asList(), as
Collections produce content representation in their toString().
Change-Id: I5db7c1cb516f25cb8410278d1d687862de471c6a
Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de>
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug302580.java')
-rw-r--r-- | bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug302580.java | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug302580.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug302580.java index d17b03a60..ad0507f6c 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug302580.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug302580.java @@ -46,10 +46,9 @@ public class Bug302580 extends AbstractPlannerTest { Operand ops[] = plan.getOperands(); String message = "The plan:\n"; - for (int i = 0; i < ops.length; i++) { - if (ops[i] instanceof InstallableUnitOperand) { - InstallableUnitOperand iuo = (InstallableUnitOperand) ops[i]; - + for (Operand op : ops) { + if (op instanceof InstallableUnitOperand) { + InstallableUnitOperand iuo = (InstallableUnitOperand) op; if (iuo.first() == null) { message += iuo.second() + " will be installed\n"; } @@ -63,10 +62,9 @@ public class Bug302580 extends AbstractPlannerTest { } System.out.println(message); - for (int i = 0; i < ops.length; i++) { - if (ops[i] instanceof InstallableUnitOperand) { - InstallableUnitOperand iuo = (InstallableUnitOperand) ops[i]; - + for (Operand op : ops) { + if (op instanceof InstallableUnitOperand) { + InstallableUnitOperand iuo = (InstallableUnitOperand) op; if (iuo.second() == null) { String id = iuo.first().getId(); if (id.equals("toolingorg.eclipse.equinox.launcher") || id.equals("toolingorg.eclipse.equinox.p2.reconciler.dropins") || id.equals("toolingorg.eclipse.equinox.simpleconfigurator")) { |