Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4463280

wrong value returned by getSupportedAttributeValues for Copies.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.0
    • 1.4.0
    • client-libs
    • None
    • 2d
    • beta2
    • generic
    • generic

      Documentation says getSupportedAttributeValues for Copies should return CopiesSupported not Copies. Because of this, the code below results in ClassCastException.

      import javax.print.*;
      import javax.print.attribute.*;
      import javax.print.attribute.standard.*;

      public class GetCopiesSupported {

          public static void main(String args[]) {
          PrintService service = PrintServiceLookup.lookupDefaultPrintService();

              if (service != null) {
                  CopiesSupported c = (CopiesSupported)
                     service.getSupportedAttributeValues(Copies.class,
                                                         null, null);

                 System.out.println("CopiesSupported : "+c);
          }
          }
      }

            jgodinez Jennifer Godinez (Inactive)
            jgodinez Jennifer Godinez (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: