changeset 9872:b7576650c22f

8035162: Service printing service Reviewed-by: bae, jgodinez, mschoene
author prr
date Tue, 24 Jun 2014 10:19:49 -0700
parents b4137b9802b4
children 0ee2d7cc9c54
files src/solaris/classes/sun/print/CUPSPrinter.java src/solaris/classes/sun/print/IPPPrintService.java
diffstat 2 files changed, 10 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/solaris/classes/sun/print/CUPSPrinter.java	Mon Jun 23 13:07:22 2014 -0700
+++ b/src/solaris/classes/sun/print/CUPSPrinter.java	Tue Jun 24 10:19:49 2014 -0700
@@ -126,7 +126,7 @@
     /**
      * Returns array of MediaSizeNames derived from PPD.
      */
-    public MediaSizeName[] getMediaSizeNames() {
+    MediaSizeName[] getMediaSizeNames() {
         initMedia();
         return cupsMediaSNames;
     }
@@ -135,7 +135,7 @@
     /**
      * Returns array of Custom MediaSizeNames derived from PPD.
      */
-    public CustomMediaSizeName[] getCustomMediaSizeNames() {
+    CustomMediaSizeName[] getCustomMediaSizeNames() {
         initMedia();
         return cupsCustomMediaSNames;
     }
@@ -144,7 +144,7 @@
     /**
      * Returns array of MediaPrintableArea derived from PPD.
      */
-    public MediaPrintableArea[] getMediaPrintableArea() {
+    MediaPrintableArea[] getMediaPrintableArea() {
         initMedia();
         return cupsMediaPrintables;
     }
@@ -152,7 +152,7 @@
     /**
      * Returns array of MediaTrays derived from PPD.
      */
-    public MediaTray[] getMediaTrays() {
+    MediaTray[] getMediaTrays() {
         initMedia();
         return cupsMediaTrays;
     }
--- a/src/solaris/classes/sun/print/IPPPrintService.java	Mon Jun 23 13:07:22 2014 -0700
+++ b/src/solaris/classes/sun/print/IPPPrintService.java	Tue Jun 24 10:19:49 2014 -0700
@@ -993,7 +993,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();
@@ -1050,7 +1052,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;
     }