Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6653384
Votes 28
Synopsis Variable "initialized" in class CUPSPrinter is static by mistake
Category java:classes_2d
Reported Against
Release Fixed 7(b43), 6u12(b02) (Bug ID:2169415)
State 10-Fix Delivered, bug
Priority: 4-Low
Related Bugs 6390756 , 6495924 , 6658736
Submit Date 22-JAN-2008
Description
FULL PRODUCT VERSION :
java version "1.6.0_04"
Java(TM) SE Runtime Environment (build 1.6.0_04-b12)
Java HotSpot(TM) Server VM (build 10.0-b19, mixed mode)
java version "1.5.0_14"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_14-b03)
Java HotSpot(TM) Server VM (build 1.5.0_14-b03, mixed mode)


ADDITIONAL OS VERSION INFORMATION :
Suse Linus Enterprice Server 10

output of uname -a:
Linux <hostname> 2.6.16.21-0.8-bigsmp #1 SMP Mon Jul 3 18:25:39 UTC 2006 i686 i686 i386 GNU/Linux


EXTRA RELEVANT SYSTEM CONFIGURATION :
CUPS version 1.1.23

A DESCRIPTION OF THE PROBLEM :
Today I found yet another bug in the sun.print.CUPSPrinter class, which as well is responsible for the following NullPointerException (especially in a multi threaded application, see as well Bug ID 6390756):

    java.lang.NullPointerException
            at sun.print.IPPPrintService.findCustomMedia(IPPPrintService.java:845)
            at sun.print.UnixPrintJob.print(UnixPrintJob.java:328)
            ...

In the source of class sun.print.CUPSPrinter, I saw that the variable "initialized" was on the one hand a static variable and on the other hand used to control the initialization of instance variables ( customer  particular the array cupsCustomMediaSNames) in method initMedia(). This of cource causes trouble when more than one CUPSPrinter instances are created, without calling initMedia() immediately after instantiation (to be precise: before the next CUPSPrinter instance is created).



REPRODUCIBILITY :
This bug can be reproduced often.
Posted Date : 2008-02-04 13:31:59.0
Work Around
N/A
Evaluation
As described, need to remove static and synchronize initMedia.
Posted Date : 2008-11-11 23:28:57.0
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang