Skip to content

Commit 9d8bca1

Browse files
committed
refactor: improve javadoc styling and add missing tag
1 parent 74959da commit 9d8bca1

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

logunit-jul/src/main/java/io/github/netmikey/logunit/jul/JulLogProvider.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,11 @@ public class JulLogProvider extends BaseLogProvider {
2323

2424
private final ListHandler listHandler = new ListHandler();
2525

26-
// We hold references to loggers we have intercepted to avoid them being garbage collected and reconstructed without
27-
// our handler in between beforeTestExecution and the actual test business logic.
26+
/**
27+
* We hold references to loggers we have intercepted to avoid them being
28+
* garbage collected and reconstructed without our handler in between
29+
* beforeTestExecution and the actual test business logic.
30+
*/
2831
private final Map<String, Logger> loggers = new HashMap<>();
2932

3033
private final Map<String, Level> originalLevels = new HashMap<>();

logunit-jul/src/test/java/io/github/netmikey/logunit/jul/LogCapturerWithJulTest.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,15 @@ public class LogCapturerWithJulTest {
3535
* above when no level is specified</li>
3636
* <li>that the namedLogger (by logger name) captures only the WARN level
3737
* and above as specified</li>
38-
* <li>both loggers and their capturers don't affeact each other</li>
38+
* <li>both loggers and their capturers don't affect each other</li>
3939
* <li>logger is not garbage collected, losing interception</li>
4040
* </ul>
41+
*
42+
* @throws Exception
43+
* Unexpected failure.
4144
*/
4245
@Test
43-
public void test1CaptureMessages() throws InterruptedException {
46+
public void test1CaptureMessages() throws Exception {
4447
System.gc();
4548
Thread.sleep(50);
4649

@@ -86,8 +89,11 @@ private void logEverythingOnce(Logger logger) {
8689
logger.severe("Some severe message");
8790
}
8891

89-
// The logger will not be constructed until the object is. This tests that log messages will be captured
90-
// without allowing the intercepted Logger to be garbage collected.
92+
/**
93+
* The logger will not be constructed until the object is. This tests that
94+
* log messages will be captured without allowing the intercepted Logger to
95+
* be garbage collected.
96+
*/
9197
private static class LoggingObject {
9298
Logger testLogger = Logger.getLogger(LoggingObject.class.getName());
9399
}

0 commit comments

Comments
 (0)