📍Use lombok, reformat, and optimize the code (#1560)

* Use lombok, reformat, and optimize the code

* Fix merge conflicts and some sonar issues

Co-authored-by: va1m <va1m@email.com>
This commit is contained in:
va1m
2021-03-13 13:19:21 +01:00
committed by GitHub
parent 0e26a6adb5
commit 5cf2fe009b
681 changed files with 2472 additions and 4966 deletions

View File

@ -54,10 +54,9 @@ public abstract class Task {
public abstract void execute();
}
@Slf4j
public final class SimpleTask extends Task {
private static final Logger LOGGER = getLogger(SimpleTask.class);
@Override
public void execute() {
LOGGER.info("Perform some important activity and after call the callback method.");

View File

@ -23,19 +23,16 @@
package com.iluwatar.callback;
import static org.slf4j.LoggerFactory.getLogger;
import org.slf4j.Logger;
import lombok.extern.slf4j.Slf4j;
/**
* Callback pattern is more native for functional languages where functions are treated as
* first-class citizens. Prior to Java 8 callbacks can be simulated using simple (alike command)
* interfaces.
*/
@Slf4j
public final class App {
private static final Logger LOGGER = getLogger(App.class);
private App() {
}

View File

@ -23,20 +23,16 @@
package com.iluwatar.callback;
import static org.slf4j.LoggerFactory.getLogger;
import org.slf4j.Logger;
import lombok.extern.slf4j.Slf4j;
/**
* Implementation of task that need to be executed.
*/
@Slf4j
public final class SimpleTask extends Task {
private static final Logger LOGGER = getLogger(SimpleTask.class);
@Override
public void execute() {
LOGGER.info("Perform some important activity and after call the"
+ " callback method.");
LOGGER.info("Perform some important activity and after call the callback method.");
}
}

View File

@ -38,7 +38,7 @@ public class CallbackTest {
private Integer callingCount = 0;
@Test
public void test() {
void test() {
Callback callback = () -> callingCount++;
var task = new SimpleTask();