📍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:
@ -25,8 +25,7 @@ package com.iluwatar.dirtyflag;
|
||||
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* This application demonstrates the <b>Dirty Flag</b> pattern. The dirty flag behavioral pattern
|
||||
@ -51,10 +50,9 @@ import org.slf4j.LoggerFactory;
|
||||
* re-fetches from <i>world.txt</i> when needed. {@link World} mainly serves the data to the
|
||||
* front-end.
|
||||
*/
|
||||
@Slf4j
|
||||
public class App {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(App.class);
|
||||
|
||||
/**
|
||||
* Program execution point.
|
||||
*/
|
||||
|
@ -29,18 +29,16 @@ import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* A mock database manager -- Fetches data from a raw file.
|
||||
*
|
||||
* @author swaisuan
|
||||
*/
|
||||
@Slf4j
|
||||
public class DataFetcher {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(DataFetcher.class);
|
||||
|
||||
private final String filename = "world.txt";
|
||||
private long lastFetched;
|
||||
|
||||
|
@ -37,7 +37,7 @@ public class World {
|
||||
private final DataFetcher df;
|
||||
|
||||
public World() {
|
||||
this.countries = new ArrayList<String>();
|
||||
this.countries = new ArrayList<>();
|
||||
this.df = new DataFetcher();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user