changeset 7756:9e6431b4536f

8035162: Service printing service Reviewed-by: bae, jgodinez, mschoene Contributed-by: artem.malinko@oracle.com
author mcherkas
date Mon, 14 Jul 2014 17:00:32 +0400
parents 2f55aad6fcb7
children 2cf4e3c9f8fe
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	Tue Jul 08 09:35:29 2014 -0700
+++ b/src/solaris/classes/sun/print/CUPSPrinter.java	Mon Jul 14 17:00:32 2014 +0400
@@ -121,7 +121,7 @@
     /**
      * Returns array of MediaSizeNames derived from PPD.
      */
-    public MediaSizeName[] getMediaSizeNames() {
+    MediaSizeName[] getMediaSizeNames() {
         initMedia();
         return cupsMediaSNames;
     }
@@ -130,7 +130,7 @@
     /**
      * Returns array of Custom MediaSizeNames derived from PPD.
      */
-    public CustomMediaSizeName[] getCustomMediaSizeNames() {
+    CustomMediaSizeName[] getCustomMediaSizeNames() {
         initMedia();
         return cupsCustomMediaSNames;
     }
@@ -139,7 +139,7 @@
     /**
      * Returns array of MediaPrintableArea derived from PPD.
      */
-    public MediaPrintableArea[] getMediaPrintableArea() {
+    MediaPrintableArea[] getMediaPrintableArea() {
         initMedia();
         return cupsMediaPrintables;
     }
@@ -147,7 +147,7 @@
     /**
      * Returns array of MediaTrays derived from PPD.
      */
-    public MediaTray[] getMediaTrays() {
+    MediaTray[] getMediaTrays() {
         initMedia();
         return cupsMediaTrays;
     }
--- a/src/solaris/classes/sun/print/IPPPrintService.java	Tue Jul 08 09:35:29 2014 -0700
+++ b/src/solaris/classes/sun/print/IPPPrintService.java	Mon Jul 14 17:00:32 2014 +0400
@@ -991,7 +991,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();
@@ -1048,7 +1050,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;
     }