Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Hammer2019-09-25 20:04:49 +0000
committerAlexander Kurtakov2019-10-27 09:12:49 +0000
commit6862bac5b2c881540e8ee99020975a89cb997684 (patch)
treef329286fab97aeb4cc57d418ae3d310f0b9e6611 /bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug302580.java
parent3d0b351e0d3f340bcc26f7a651f4eebfc817b722 (diff)
downloadrt.equinox.p2-6862bac5b2c881540e8ee99020975a89cb997684.tar.gz
rt.equinox.p2-6862bac5b2c881540e8ee99020975a89cb997684.tar.xz
rt.equinox.p2-6862bac5b2c881540e8ee99020975a89cb997684.zip
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.java14
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")) {

Back to the top