Skip to content

Commit 31f27a7

Browse files
altaiezioriluwatar
authored andcommitted
Resolves checkstyle errors for callback, chain, circuit-breaker (iluwatar#1060)
* Reduces checkstyle errors in callback * Reduces checkstyle errors in chain * Reduces checkstyle errors in circuit-breaker
1 parent efc17fc commit 31f27a7

File tree

18 files changed

+114
-125
lines changed

18 files changed

+114
-125
lines changed

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

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,14 @@
2323

2424
package com.iluwatar.callback;
2525

26-
import org.slf4j.Logger;
27-
2826
import static org.slf4j.LoggerFactory.getLogger;
2927

28+
import org.slf4j.Logger;
29+
3030
/**
31-
*
32-
* Callback pattern is more native for functional languages where functions are
33-
* treated as first-class citizens. Prior to Java 8 callbacks can be simulated
34-
* using simple (alike command) interfaces.
35-
*
31+
* Callback pattern is more native for functional languages where functions are treated as
32+
* first-class citizens. Prior to Java 8 callbacks can be simulated using simple (alike command)
33+
* interfaces.
3634
*/
3735
public final class App {
3836

@@ -42,7 +40,7 @@ private App() {
4240
}
4341

4442
/**
45-
* Program entry point
43+
* Program entry point.
4644
*/
4745
public static void main(final String[] args) {
4846
Task task = new SimpleTask();

callback/src/main/java/com/iluwatar/callback/Callback.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@
2424
package com.iluwatar.callback;
2525

2626
/**
27-
*
28-
* Callback interface
29-
*
27+
* Callback interface.
3028
*/
3129
public interface Callback {
3230

callback/src/main/java/com/iluwatar/callback/LambdasApp.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,23 @@
2323

2424
package com.iluwatar.callback;
2525

26-
import org.slf4j.Logger;
27-
2826
import static org.slf4j.LoggerFactory.getLogger;
2927

28+
import org.slf4j.Logger;
29+
3030
/**
31-
*
32-
* This example generates the exact same output as {@link App} however the
33-
* callback has been defined as a Lambdas expression.
34-
*
31+
* This example generates the exact same output as {@link App} however the callback has been defined
32+
* as a Lambdas expression.
3533
*/
3634
public final class LambdasApp {
3735

3836
private static final Logger LOGGER = getLogger(LambdasApp.class);
3937

40-
private LambdasApp() { }
38+
private LambdasApp() {
39+
}
4140

4241
/**
43-
* Program entry point
42+
* Program entry point.
4443
*/
4544
public static void main(final String[] args) {
4645
Task task = new SimpleTask();

callback/src/main/java/com/iluwatar/callback/SimpleTask.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,12 @@
2323

2424
package com.iluwatar.callback;
2525

26-
import org.slf4j.Logger;
27-
2826
import static org.slf4j.LoggerFactory.getLogger;
2927

28+
import org.slf4j.Logger;
29+
3030
/**
31-
*
32-
* Implementation of task that need to be executed
33-
*
31+
* Implementation of task that need to be executed.
3432
*/
3533
public final class SimpleTask extends Task {
3634

@@ -39,6 +37,6 @@ public final class SimpleTask extends Task {
3937
@Override
4038
public void execute() {
4139
LOGGER.info("Perform some important activity and after call the"
42-
+ " callback method.");
40+
+ " callback method.");
4341
}
4442
}

callback/src/main/java/com/iluwatar/callback/Task.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,12 @@
2424
package com.iluwatar.callback;
2525

2626
/**
27-
*
28-
* Template-method class for callback hook execution
29-
*
27+
* Template-method class for callback hook execution.
3028
*/
3129
public abstract class Task {
3230

3331
/**
34-
* Execute with callback
32+
* Execute with callback.
3533
*/
3634
final void executeWith(final Callback callback) {
3735
execute();

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

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,21 @@
2424
package com.iluwatar.chain;
2525

2626
/**
27-
*
2827
* The Chain of Responsibility pattern is a design pattern consisting of command objects and a
2928
* series of processing objects. Each processing object contains logic that defines the types of
3029
* command objects that it can handle; the rest are passed to the next processing object in the
3130
* chain. A mechanism also exists for adding new processing objects to the end of this chain.
32-
* <p>
33-
* In this example we organize the request handlers ({@link RequestHandler}) into a chain where each
34-
* handler has a chance to act on the request on its turn. Here the king ({@link OrcKing}) makes
35-
* requests and the military orcs ({@link OrcCommander}, {@link OrcOfficer}, {@link OrcSoldier})
36-
* form the handler chain.
37-
*
31+
*
32+
* <p>In this example we organize the request handlers ({@link RequestHandler}) into a chain where
33+
* each handler has a chance to act on the request on its turn. Here the king ({@link OrcKing})
34+
* makes requests and the military orcs ({@link OrcCommander}, {@link OrcOfficer}, {@link
35+
* OrcSoldier}) form the handler chain.
3836
*/
3937
public class App {
4038

4139
/**
42-
* Program entry point
43-
*
40+
* Program entry point.
41+
*
4442
* @param args command line args
4543
*/
4644
public static void main(String[] args) {

chain/src/main/java/com/iluwatar/chain/OrcCommander.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@
2424
package com.iluwatar.chain;
2525

2626
/**
27-
*
28-
* OrcCommander
29-
*
27+
* OrcCommander.
3028
*/
3129
public class OrcCommander extends RequestHandler {
3230

chain/src/main/java/com/iluwatar/chain/OrcKing.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@
2424
package com.iluwatar.chain;
2525

2626
/**
27-
*
2827
* OrcKing makes requests that are handled by the chain.
29-
*
3028
*/
3129
public class OrcKing {
3230

chain/src/main/java/com/iluwatar/chain/OrcOfficer.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@
2424
package com.iluwatar.chain;
2525

2626
/**
27-
*
28-
* OrcOfficer
29-
*
27+
* OrcOfficer.
3028
*/
3129
public class OrcOfficer extends RequestHandler {
3230

chain/src/main/java/com/iluwatar/chain/OrcSoldier.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@
2424
package com.iluwatar.chain;
2525

2626
/**
27-
*
28-
* OrcSoldier
29-
*
27+
* OrcSoldier.
3028
*/
3129
public class OrcSoldier extends RequestHandler {
3230

0 commit comments

Comments
 (0)