changeset 10853:770b41d2ace1

8035162: Service printing service Reviewed-by: bae, jgodinez, mschoene
author prr
date Tue, 24 Jun 2014 10:03:46 -0700
parents 46ff4ef2f18e
children f9c1a3291829
files src/java.desktop/unix/classes/sun/print/CUPSPrinter.java src/java.desktop/unix/classes/sun/print/IPPPrintService.java
diffstat 2 files changed, 10 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.desktop/unix/classes/sun/print/CUPSPrinter.java	Wed Jun 11 16:25:59 2014 -0400
+++ b/src/java.desktop/unix/classes/sun/print/CUPSPrinter.java	Tue Jun 24 10:03:46 2014 -0700
@@ -136,7 +136,7 @@
     /**
      * Returns array of MediaSizeNames derived from PPD.
      */
-    public MediaSizeName[] getMediaSizeNames() {
+    MediaSizeName[] getMediaSizeNames() {
         initMedia();
         return cupsMediaSNames;
     }
@@ -145,7 +145,7 @@
     /**
      * Returns array of Custom MediaSizeNames derived from PPD.
      */
-    public CustomMediaSizeName[] getCustomMediaSizeNames() {
+    CustomMediaSizeName[] getCustomMediaSizeNames() {
         initMedia();
         return cupsCustomMediaSNames;
     }
@@ -157,7 +157,7 @@
     /**
      * Returns array of MediaPrintableArea derived from PPD.
      */
-    public MediaPrintableArea[] getMediaPrintableArea() {
+    MediaPrintableArea[] getMediaPrintableArea() {
         initMedia();
         return cupsMediaPrintables;
     }
@@ -165,7 +165,7 @@
     /**
      * Returns array of MediaTrays derived from PPD.
      */
-    public MediaTray[] getMediaTrays() {
+    MediaTray[] getMediaTrays() {
         initMedia();
         return cupsMediaTrays;
     }
--- a/src/java.desktop/unix/classes/sun/print/IPPPrintService.java	Wed Jun 11 16:25:59 2014 -0400
+++ b/src/java.desktop/unix/classes/sun/print/IPPPrintService.java	Tue Jun 24 10:03:46 2014 -0700
@@ -1002,7 +1002,9 @@
 
     public synchronized Class<?>[] getSupportedAttributeCategories() {
         if (supportedCats != null) {
-            return supportedCats;
+            Class<?> [] copyCats = new Class<?>[supportedCats.length];
+            System.arraycopy(supportedCats, 0, copyCats, 0, copyCats.length);
+            return copyCats;
         }
 
         initAttributes();
@@ -1065,7 +1067,9 @@
 
         supportedCats = new Class<?>[catList.size()];
         catList.toArray(supportedCats);
-        return supportedCats;
+        Class<?>[] copyCats = new Class<?>[supportedCats.length];
+        System.arraycopy(supportedCats, 0, copyCats, 0, copyCats.length);
+        return copyCats;
     }