From e3c335cbd18659d78e6609ecef4a7d039d6e0a6a Mon Sep 17 00:00:00 2001 From: AlexanderScherbatiy Date: Tue, 21 May 2024 07:29:59 +0300 Subject: [PATCH] Exclude OuptutBin from supported category if number of output bins is zero --- .../unix/classes/sun/print/IPPPrintService.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/java.desktop/unix/classes/sun/print/IPPPrintService.java b/src/java.desktop/unix/classes/sun/print/IPPPrintService.java index a41786e0ea975..edd1a07185f0d 100644 --- a/src/java.desktop/unix/classes/sun/print/IPPPrintService.java +++ b/src/java.desktop/unix/classes/sun/print/IPPPrintService.java @@ -1131,6 +1131,11 @@ public synchronized Class[] getSupportedAttributeCategories() { (PrintRequestAttribute)printReqAttribDefault[i]; if (getAttMap != null && getAttMap.containsKey(pra.getName()+"-supported")) { + + if (pra == OutputBin.TOP && (outputBins == null || outputBins.length == 0)) { + continue; + } + catList.add(pra.getCategory()); } } @@ -1209,6 +1214,11 @@ public synchronized Class[] getSupportedAttributeCategories() { return true; } + if (category == OutputBin.class + && (outputBins == null || outputBins.length == 0)) { + return false; + } + for (int i=0;i