Change 'Iterator' to 'for' loop in PrintController.java
authorCarlos Aristu <carlos.aristu@openbravo.com>
Thu, 21 May 2015 12:38:47 +0200
changeset 26760 51e873022c10
parent 26759 30ce2d42cf6d
child 26761 b4a29c1c6c4f
Change 'Iterator' to 'for' loop in PrintController.java
src/org/openbravo/erpCommon/utility/reporting/printing/PrintController.java
--- a/src/org/openbravo/erpCommon/utility/reporting/printing/PrintController.java	Thu May 21 11:15:48 2015 +0200
+++ b/src/org/openbravo/erpCommon/utility/reporting/printing/PrintController.java	Thu May 21 12:38:47 2015 +0200
@@ -477,8 +477,7 @@
       response.setContentType("application/pdf");
 
       if (!multiReports && !archivedReports) {
-        for (Iterator<Report> iterator = reports.iterator(); iterator.hasNext();) {
-          Report report = iterator.next();
+        for (Report report : reports) {
           filename = report.getFilename();
         }
         response.setHeader("Content-disposition", "attachment" + "; filename=" + filename);
@@ -489,8 +488,7 @@
       } else {
         concatReport(reports.toArray(new Report[] {}), jrPrintReports, response);
       }
-      for (Iterator<Report> iterator = reports.iterator(); iterator.hasNext();) {
-        Report report = iterator.next();
+      for (Report report : reports) {
         switch (report.getDocumentType()) {
         case SALESORDER:
           PrintControllerData.updateOrderDatePrinted(this, report.getDocumentId());
@@ -643,6 +641,8 @@
       return PocData.getContactDetailsForOrders(this, strDocumentId);
     case PAYMENT:
       return PocData.getContactDetailsForPayments(this, strDocumentId);
+    case UNKNOWN:
+      return null;
     }
     return null;
   }