Skip to content

Commit 5d88068

Browse files
committed
Review comments++
1 parent f67d2fd commit 5d88068

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

module/src/main/java/com/iluwatar/module/App.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,8 @@ public final class App {
4545
public static void prepare() throws FileNotFoundException {
4646

4747
/* Create new singleton objects and prepare their modules */
48-
fileLoggerModule = FileLoggerModule.getSingleton();
49-
consoleLoggerModule = ConsoleLoggerModule.getSingleton();
50-
51-
/* Prepare modules */
52-
fileLoggerModule.prepare();
53-
consoleLoggerModule.prepare();
48+
fileLoggerModule = FileLoggerModule.getSingleton().prepare();
49+
consoleLoggerModule = ConsoleLoggerModule.getSingleton().prepare();
5450
}
5551

5652
/**

module/src/main/java/com/iluwatar/module/ConsoleLoggerModule.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,14 @@ public static ConsoleLoggerModule getSingleton() {
5656
/**
5757
* Following method performs the initialization
5858
*/
59-
public void prepare() {
59+
public ConsoleLoggerModule prepare() {
6060

6161
LOGGER.debug("ConsoleLoggerModule::prepare();");
6262

6363
this.output = new PrintStream(System.out);
6464
this.error = new PrintStream(System.err);
65+
66+
return this;
6567
}
6668

6769
/**

module/src/main/java/com/iluwatar/module/FileLoggerModule.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,14 @@ public static FileLoggerModule getSingleton() {
6464
* @throws FileNotFoundException if program is not able to find log files (output.txt and
6565
* error.txt)
6666
*/
67-
public void prepare() throws FileNotFoundException {
67+
public FileLoggerModule prepare() throws FileNotFoundException {
6868

6969
LOGGER.debug("FileLoggerModule::prepare();");
7070

7171
this.output = new PrintStream(new FileOutputStream(OUTPUT_FILE));
7272
this.error = new PrintStream(new FileOutputStream(ERROR_FILE));
73+
74+
return this;
7375
}
7476

7577
/**

0 commit comments

Comments
 (0)