src/share/classes/sun/print/RasterPrinterJob.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -179,24 +179,22 @@
         /* The system property FORCE_PIPE_PROP
          * can be used to force the printing code to
          * use a particular pipeline. Either the raster
          * pipeline or the pdl pipeline can be forced.
          */
-        String forceStr =
-           (String)java.security.AccessController.doPrivileged(
+        String forceStr = java.security.AccessController.doPrivileged(
                    new sun.security.action.GetPropertyAction(FORCE_PIPE_PROP));
 
         if (forceStr != null) {
             if (forceStr.equalsIgnoreCase(FORCE_PDL)) {
                 forcePDL = true;
             } else if (forceStr.equalsIgnoreCase(FORCE_RASTER)) {
                 forceRaster = true;
             }
         }
 
-        String shapeTextStr =
-           (String)java.security.AccessController.doPrivileged(
+        String shapeTextStr =java.security.AccessController.doPrivileged(
                    new sun.security.action.GetPropertyAction(SHAPE_TEXT_PROP));
 
         if (shapeTextStr != null) {
             shapeTextProp = true;
         }

@@ -510,16 +508,14 @@
                    service.getName() == null) {
             throw new PrinterException("Null PrintService name.");
         } else {
             // Check the list of services.  This service may have been
             // deleted already
-            PrinterState prnState = (PrinterState)service.getAttribute(
-                                                  PrinterState.class);
+            PrinterState prnState = service.getAttribute(PrinterState.class);
             if (prnState == PrinterState.STOPPED) {
                 PrinterStateReasons prnStateReasons =
-                    (PrinterStateReasons)service.getAttribute(
-                                                 PrinterStateReasons.class);
+                    service.getAttribute(PrinterStateReasons.class);
                 if ((prnStateReasons != null) &&
                     (prnStateReasons.containsKey(PrinterStateReason.SHUTDOWN)))
                 {
                     throw new PrinterException("PrintService is no longer available.");
                 }

@@ -1351,25 +1347,22 @@
             throw new PrinterException("No print service found.");
         }
 
         // Check the list of services.  This service may have been
         // deleted already
-        PrinterState prnState = (PrinterState)psvc.getAttribute(
-                                                  PrinterState.class);
+        PrinterState prnState = psvc.getAttribute(PrinterState.class);
         if (prnState == PrinterState.STOPPED) {
             PrinterStateReasons prnStateReasons =
-                    (PrinterStateReasons)psvc.getAttribute(
-                                                 PrinterStateReasons.class);
+                    psvc.getAttribute(PrinterStateReasons.class);
                 if ((prnStateReasons != null) &&
                     (prnStateReasons.containsKey(PrinterStateReason.SHUTDOWN)))
                 {
                     throw new PrinterException("PrintService is no longer available.");
                 }
         }
 
-        if ((PrinterIsAcceptingJobs)(psvc.getAttribute(
-                         PrinterIsAcceptingJobs.class)) ==
+        if ((psvc.getAttribute(PrinterIsAcceptingJobs.class)) ==
                          PrinterIsAcceptingJobs.NOT_ACCEPTING_JOBS) {
             throw new PrinterException("Printer is not accepting job.");
         }
 
         if ((psvc instanceof SunPrinterJobService) &&

@@ -2033,11 +2026,11 @@
         /* Figure out the number of lines that will fit into
          * our maximum band size. The hard coded 3 reflects the
          * fact that we can only create 24 bit per pixel 3 byte BGR
          * BufferedImages. FIX.
          */
-        int bandHeight = (int)(MAX_BAND_SIZE / bandWidth / 3);
+        int bandHeight = (MAX_BAND_SIZE / bandWidth / 3);
 
         int deviceLeft = (int)Math.rint(paper.getImageableX() * xScale);
         int deviceTop  = (int)Math.rint(paper.getImageableY() * yScale);
 
         /* The device transform is used to move the band down