-
Bug
-
Resolution: Fixed
-
P4
-
1.4.0, 9
-
b36
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8085091 | emb-9 | Philip Race | P4 | Resolved | Fixed | team |
Consider the following code:
----------------------------------------------------------
import javax.print.PrintServiceLookup;
import java.util.Arrays;
public class PS {
public static void main(String[] args) {
final boolean registered = PrintServiceLookup.registerService(null);
System.out.println("registered? " + registered);
System.out.println("services = " + Arrays.toString(PrintServiceLookup.lookupPrintServices(null, null)));
}
}
----------------------------------------------------------
After running it v.s. JDK8 updates the output will contain
----
registered? true
...
----
and the list of services with null among them.
This doesn't look like conforming to the spec of the methods:
http://docs.oracle.com/javase/8/docs/api/javax/print/PrintServiceLookup.html#registerService-javax.print.PrintService-
http://docs.oracle.com/javase/8/docs/api/javax/print/PrintServiceLookup.html#lookupPrintServices-javax.print.DocFlavor-javax.print.attribute.AttributeSet-
The spec needs to be clarified or behavior corrected.
----------------------------------------------------------
import javax.print.PrintServiceLookup;
import java.util.Arrays;
public class PS {
public static void main(String[] args) {
final boolean registered = PrintServiceLookup.registerService(null);
System.out.println("registered? " + registered);
System.out.println("services = " + Arrays.toString(PrintServiceLookup.lookupPrintServices(null, null)));
}
}
----------------------------------------------------------
After running it v.s. JDK8 updates the output will contain
----
registered? true
...
----
and the list of services with null among them.
This doesn't look like conforming to the spec of the methods:
http://docs.oracle.com/javase/8/docs/api/javax/print/PrintServiceLookup.html#registerService-javax.print.PrintService-
http://docs.oracle.com/javase/8/docs/api/javax/print/PrintServiceLookup.html#lookupPrintServices-javax.print.DocFlavor-javax.print.attribute.AttributeSet-
The spec needs to be clarified or behavior corrected.
- backported by
-
JDK-8085091 javax.print.PrintServiceLookup allows to register null service
-
- Resolved
-