Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Hammer2019-11-21 19:13:49 +0000
committerKarsten Thoms2019-12-10 15:34:41 +0000
commitf493771dcaed40138c0c550656d65d6d8d43dce7 (patch)
tree2531a81eae49c0cfbeb5887f3092488585c6d6d8
parent5939702a7abaf866f5cd5f64e1d1caed7368fc77 (diff)
downloadeclipse.platform.swt-f493771dcaed40138c0c550656d65d6d8d43dce7.tar.gz
eclipse.platform.swt-f493771dcaed40138c0c550656d65d6d8d43dce7.tar.xz
eclipse.platform.swt-f493771dcaed40138c0c550656d65d6d8d43dce7.zip
Use jdk 5 for-each loop
Replace simple uses of Iterator with a corresponding for-loop. Also add missing braces on loops as necessary. Change-Id: Iba59ff4f07002074df43f39b071cc903bb9b61bf Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Printing/win32/org/eclipse/swt/printing/PrintDialog.java17
1 files changed, 7 insertions, 10 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Printing/win32/org/eclipse/swt/printing/PrintDialog.java b/bundles/org.eclipse.swt/Eclipse SWT Printing/win32/org/eclipse/swt/printing/PrintDialog.java
index 38af0a7114..dd0c96241d 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Printing/win32/org/eclipse/swt/printing/PrintDialog.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Printing/win32/org/eclipse/swt/printing/PrintDialog.java
@@ -327,13 +327,10 @@ public PrinterData open() {
boolean success = false;
if (printerData.name != null) {
/* Ensure that the printer name is in the current list of printers. */
- PrinterData printerList[] = Printer.getPrinterList();
- if (printerList.length > 0) {
- for (int p = 0; p < printerList.length; p++) {
- if (printerList[p].name.equals(printerData.name)) {
- success = true;
- break;
- }
+ for (PrinterData element : Printer.getPrinterList()) {
+ if (element.name.equals(printerData.name)) {
+ success = true;
+ break;
}
}
if (success) {
@@ -453,9 +450,9 @@ public PrinterData open() {
display.sendPostExternalEventDispatchEvent ();
display.setData(key, oldValue);
if ((getStyle() & (SWT.APPLICATION_MODAL | SWT.SYSTEM_MODAL)) != 0) {
- for (int i=0; i<shells.length; i++) {
- if (shells[i] != null && !shells[i].isDisposed ()) {
- shells[i].setEnabled(true);
+ for (Shell shell : shells) {
+ if (shell != null && !shell.isDisposed ()) {
+ shell.setEnabled(true);
}
}
}

Back to the top