Skip to content

Commit 7dc47da

Browse files
committed
iluwatar#1021 Checkstyle fixes for Composite pattern
1 parent 0b17abd commit 7dc47da

File tree

6 files changed

+18
-26
lines changed

6 files changed

+18
-26
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,17 @@
3232
* of a composite is to "compose" objects into tree structures to represent part-whole hierarchies.
3333
* Implementing the Composite pattern lets clients treat individual objects and compositions
3434
* uniformly.
35-
* <p>
36-
* In this example we have sentences composed of words composed of letters. All of the objects can
37-
* be treated through the same interface ({@link LetterComposite}).
35+
*
36+
* <p>In this example we have sentences composed of words composed of letters. All of the objects
37+
* can be treated through the same interface ({@link LetterComposite}).
3838
*
3939
*/
4040
public class App {
4141

4242
private static final Logger LOGGER = LoggerFactory.getLogger(App.class);
4343

4444
/**
45-
* Program entry point
45+
* Program entry point.
4646
*
4747
* @param args command line args
4848
*/

composite/src/main/java/com/iluwatar/composite/Letter.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,18 @@
2424
package com.iluwatar.composite;
2525

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

33-
private char c;
31+
private char character;
3432

3533
public Letter(char c) {
36-
this.c = c;
34+
this.character = c;
3735
}
3836

3937
@Override
4038
protected void printThisBefore() {
41-
System.out.print(c);
39+
System.out.print(character);
4240
}
4341
}

composite/src/main/java/com/iluwatar/composite/LetterComposite.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@
2727
import java.util.List;
2828

2929
/**
30-
*
3130
* Composite interface.
32-
*
3331
*/
3432
public abstract class LetterComposite {
3533

@@ -43,12 +41,14 @@ public int count() {
4341
return children.size();
4442
}
4543

46-
protected void printThisBefore() {}
44+
protected void printThisBefore() {
45+
}
4746

48-
protected void printThisAfter() {}
47+
protected void printThisAfter() {
48+
}
4949

5050
/**
51-
* Print
51+
* Print.
5252
*/
5353
public void print() {
5454
printThisBefore();

composite/src/main/java/com/iluwatar/composite/Messenger.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@
2626
import java.util.List;
2727

2828
/**
29-
*
30-
* Messenger
31-
*
29+
* Messenger.
3230
*/
3331
public class Messenger {
3432

composite/src/main/java/com/iluwatar/composite/Sentence.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,12 @@
2626
import java.util.List;
2727

2828
/**
29-
*
30-
* Sentence
31-
*
29+
* Sentence.
3230
*/
3331
public class Sentence extends LetterComposite {
3432

3533
/**
36-
* Constructor
34+
* Constructor.
3735
*/
3836
public Sentence(List<Word> words) {
3937
for (Word w : words) {

composite/src/main/java/com/iluwatar/composite/Word.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,12 @@
2626
import java.util.List;
2727

2828
/**
29-
*
30-
* Word
31-
*
29+
* Word.
3230
*/
3331
public class Word extends LetterComposite {
3432

3533
/**
36-
* Constructor
34+
* Constructor.
3735
*/
3836
public Word(List<Letter> letters) {
3937
for (Letter l : letters) {

0 commit comments

Comments
 (0)