if (f.exists()) f.delete();
should use { ... } for the body - 2 cases of this one in each
of the modified files.
Other than that OK. I don't need to see an updated webrev
so long as you make those syntactic changes.
-phil
On 6/23/16, 3:40 AM, Prasanta Sadhukhan wrote:
Hi Phil, All,
Based on the offline discussion, I added the case when disk gets
filled while writing to the file.
Since PrintStream does not throw IOException, I added check for
checkError() to do the corresponding error handling. I added it after
flush() as that is where the stream will be written to the file.
http://cr.openjdk.java.net/~psadhukhan/6218397/webrev.03/
Regards
Prasanta
On 6/20/2016 12:01 PM, prasanta sadhukhan wrote:
Hi Phil,All,
Added file delete in another case where we throw PrinterException.
http://cr.openjdk.java.net/~psadhukhan/6218397/webrev.02/
Regards
Prasanta
On 6/16/2016 1:40 PM, prasanta sadhukhan wrote:
Modified webrev to close output stream.
http://cr.openjdk.java.net/~psadhukhan/6218397/webrev.01/
Regards
Prasanta
On 6/15/2016 9:52 PM, Philip Race wrote:
If this is executed on Windows (shared Postscript stream printer
could do this)
then since the output stream is still open I expect the delete will
fail.
Attempt to close the open stream first (in a try .. catch I suppose).
-phil.
On 6/15/16, 3:25 AM, prasanta sadhukhan wrote:
Hi All,
Bug: https://bugs.openjdk.java.net/browse/JDK-6218397
The issue was if the linux disk is full and we are trying to
"print to file" then PrinterException is not thrown and a 0 byte
file is created.
Although I am not able to reproduce this behaviour, because when I
make my disk full and try to run "java", I get
/Java HotSpot(TM) Server VM warning: Insufficient space for shared
memory file://
// 13783//
//Try using the -Djava.io.tmpdir= option to select an alternate
temp location./
but on investigating this, I see that we are calling
f.createNewFile() in RasterPrinterJob#validateDestination() which
creates a new, empty file
but if there is any exception in PSPrinterJob#startDoc this file
is not deleted.
Modified the code to make sure if there is any exception, delete
the file.
http://cr.openjdk.java.net/~psadhukhan/6218397/webrev.00/
Regards
Prasanta