# This patch file was generated by NetBeans IDE # Following Index: paths are relative to: E:\jarda\nball\core\startup # This patch can be applied using context Tools: Patch action on respective folder. # It uses platform neutral UTF-8 encoding and \n newlines. # Above lines and this line are ignored by the patching process. Index: src/org/netbeans/core/startup/TopLogging.java *** E:\jarda\nball\core\startup\src\org\netbeans\core\startup\TopLogging.java Base (1.11) --- E:\jarda\nball\core\startup\src\org\netbeans\core\startup\TopLogging.java Locally Modified (Based On 1.11) *************** *** 287,293 **** --- 287,306 ---- defaultHandler = null; } } + static void close() { + Handler s = streamHandler; + if (s instanceof NonClose) { + NonClose ns = (NonClose)s; + ns.doClose(); + } + Handler d = defaultHandler; + if (d != null) { + NonClose nd = (NonClose)d; + nd.doClose(); + } + } + /** Non closing handler. */ private static final class NonClose extends Handler *************** *** 312,324 **** --- 325,344 ---- public void flush() { flush.cancel(); + flush.waitFinished(); delegate.flush(); } public void close() throws SecurityException { + flush(); delegate.flush(); } + public void doClose() throws SecurityException { + flush(); + delegate.close(); + } + public Formatter getFormatter() { return delegate.getFormatter(); } Index: test/unit/src/org/netbeans/core/startup/TopLoggingOwnConfigClassTest.java *** E:\jarda\nball\core\startup\test\unit\src\org\netbeans\core\startup\TopLoggingOwnConfigClassTest.java Base (1.3) --- E:\jarda\nball\core\startup\test\unit\src\org\netbeans\core\startup\TopLoggingOwnConfigClassTest.java Locally Modified (Based On 1.3) Index: test/unit/src/org/netbeans/core/startup/TopLoggingTest.java *** E:\jarda\nball\core\startup\test\unit\src\org\netbeans\core\startup\TopLoggingTest.java Base (1.5) --- E:\jarda\nball\core\startup\test\unit\src\org\netbeans\core\startup\TopLoggingTest.java Locally Modified (Based On 1.5) *************** *** 149,156 **** --- 149,158 ---- File log2 = new File(new File(new File(getWorkDir(), "var"), "log"), "messages.log.1"); assertFalse("Currently we rotate just one file: " + log2, log2.canRead()); + TopLogging.close(); // simulate new start TopLogging.flush(true); + TopLogging.initialize(); assertTrue("2 Log file exists: " + log, log.canRead()); *************** *** 216,223 **** String disk = readLog(true); ! if (disk.indexOf("Ahoj" + System.getProperty("line.separator")) == -1) { ! fail("Expecting 'Ahoj': " + disk); } Pattern p = Pattern.compile("IllegalStateException.*Hi"); --- 218,226 ---- String disk = readLog(true); ! if (disk.indexOf("Ahoj" + (char)13) == -1) { ! int ah = disk.indexOf("Ahoj"); ! fail("Expecting 'Ahoj': index: " + ah + " next char: " + (int)disk.charAt(ah + 4) + "text:\n" + disk); } Pattern p = Pattern.compile("IllegalStateException.*Hi"); Index: test/unit/src/org/netbeans/core/startup/TopLoggingOwnConfigTest.java *** E:\jarda\nball\core\startup\test\unit\src\org\netbeans\core\startup\TopLoggingOwnConfigTest.java Base (1.3) --- E:\jarda\nball\core\startup\test\unit\src\org\netbeans\core\startup\TopLoggingOwnConfigTest.java Locally Modified (Based On 1.3)