JDK-8048020 : Regression on java.util.logging.FileHandler
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util.logging
  • Affected Version: 8
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_7
  • CPU: x86_64
  • Submitted: 2014-06-19
  • Updated: 2015-04-08
  • Resolved: 2014-07-07
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9
8u40Fixed 9 b23Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
FULL PRODUCT VERSION :
1.8.0_b123

ADDITIONAL OS VERSION INFORMATION :
Windows 7 x64

A DESCRIPTION OF THE PROBLEM :
The change

http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/rev/ac22a52a732c

causes a regression.

The parameter "append" in the constructor

public FileHandler(String pattern, int limit, int count, boolean append)

doesn't work anymore. Every time, a java program a new File is generated (when using %u in Filename), instead of appending to the existing one.


REGRESSION.  Last worked in version 7u60

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
package javaapplication23;

import java.io.IOException;
import java.util.logging.FileHandler;

public class JavaApplication23 {

    public static void main(String[] args) throws IOException {
        new FileHandler("./test_%g_%u.log", 10000, 100, true);
    }

}


EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Only the file test_0_0.log (and .lck) should be generated.
ACTUAL -
With every program start, a new file is generated (test_0_1.log, test_0_2.log, ...)

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
package javaapplication23;

import java.io.IOException;
import java.util.logging.FileHandler;

public class JavaApplication23 {

    public static void main(String[] args) throws IOException {
        new FileHandler("./test_%g_%u.log", 10000, 100, true);
    }

}

---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
not known


Comments
See also further fix for the associated test JDK-8052403
04-09-2014

Changing CREATE_NEW in CREATE also means that OverlappingFileLockException (see JDK-8031438) will need to be handled.
25-06-2014

See discussion on http://mail.openjdk.java.net/pipermail/core-libs-dev/2014-June/027296.html
24-06-2014