From 333e32f7b336f0c3a086de488b1f8798acc2482c Mon Sep 17 00:00:00 2001 From: Roman Korostinskiy <70313618+c71n93@users.noreply.github.com> Date: Tue, 5 Mar 2024 15:58:58 +0300 Subject: [PATCH] #2863 fix qulice warnings --- .../test/java/org/eolang/DataizedTest.java | 29 ++++++++++++++----- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/eo-runtime/src/test/java/org/eolang/DataizedTest.java b/eo-runtime/src/test/java/org/eolang/DataizedTest.java index c940a9fc94..65e8d24aab 100644 --- a/eo-runtime/src/test/java/org/eolang/DataizedTest.java +++ b/eo-runtime/src/test/java/org/eolang/DataizedTest.java @@ -48,7 +48,7 @@ void logsCorrectly() { final Level before = log.getLevel(); log.setLevel(Level.ALL); final List logs = new LinkedList<>(); - final Handler hnd = new TestHandler(logs); + final Handler hnd = new Hnd(logs); log.addHandler(hnd); new Dataized(new Data.ToPhi(1L), log).take(); log.setLevel(before); @@ -68,7 +68,7 @@ void logsWhenException() { final Level before = log.getLevel(); log.setLevel(Level.ALL); final List logs = new LinkedList<>(); - final Handler hnd = new TestHandler(logs); + final Handler hnd = new Hnd(logs); log.addHandler(hnd); final Phi wrong = new PhIncorrect(Phi.Φ); IntStream.range(0, 5).forEach( @@ -95,7 +95,7 @@ void printsShortLogs() throws InterruptedException { final Level before = log.getLevel(); log.setLevel(Level.ALL); final List logs = new LinkedList<>(); - final Handler hnd = new TestHandler(logs); + final Handler hnd = new Hnd(logs); log.addHandler(hnd); final Thread thread = new Thread( () -> { @@ -125,7 +125,7 @@ void printsLongLogs() throws InterruptedException { final Level before = log.getLevel(); log.setLevel(Level.ALL); final List logs = new LinkedList<>(); - final Handler hnd = new TestHandler(logs); + final Handler hnd = new Hnd(logs); log.addHandler(hnd); final Thread thread = new Thread( () -> { @@ -201,16 +201,29 @@ public static class PhiDec extends PhDefault { } } - private static class TestHandler extends Handler { - final List logs; + /** + * Handler implementation for tests. + * + * @since 1.0 + */ + private static class Hnd extends Handler { + /** + * Logs. + */ + private final List logs; - TestHandler(final List logs) { + /** + * Ctor. + * + * @param logs Logs + */ + Hnd(final List logs) { this.logs = logs; } @Override public void publish(final LogRecord record) { - logs.add(record); + this.logs.add(record); } @Override