Skip to content

Commit 47ae477

Browse files
committed
iluwatar#1021 Checkstyle changes for Factory Method
1 parent 7dc47da commit 47ae477

File tree

5 files changed

+14
-21
lines changed

5 files changed

+14
-21
lines changed

factory-method/src/main/java/com/iluwatar/factory/method/App.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,13 @@
2727
import org.slf4j.LoggerFactory;
2828

2929
/**
30-
*
3130
* The Factory Method is a creational design pattern which uses factory methods to deal with the
3231
* problem of creating objects without specifying the exact class of object that will be created.
3332
* This is done by creating objects via calling a factory method either specified in an interface
3433
* and implemented by child classes, or implemented in a base class and optionally overridden by
3534
* derived classes—rather than by calling a constructor.
36-
* <p>
37-
* In this Factory Method example we have an interface ({@link Blacksmith}) with a method for
35+
*
36+
* <p>In this Factory Method example we have an interface ({@link Blacksmith}) with a method for
3837
* creating objects ({@link Blacksmith#manufactureWeapon}). The concrete subclasses (
3938
* {@link OrcBlacksmith}, {@link ElfBlacksmith}) then override the method to produce objects of
4039
* their liking.
@@ -59,7 +58,7 @@ public App(Blacksmith blacksmith) {
5958
}
6059

6160
/**
62-
* Program entry point
61+
* Program entry point.
6362
*
6463
* @param args command line args
6564
*/

factory-method/src/main/java/com/iluwatar/factory/method/Blacksmith.java

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

2626
/**
27-
*
2827
* The interface containing method for producing objects.
29-
*
3028
*/
3129
public interface Blacksmith {
3230

factory-method/src/main/java/com/iluwatar/factory/method/ElfBlacksmith.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,17 @@
2727
import java.util.Map;
2828

2929
/**
30-
*
3130
* Concrete subclass for creating new objects.
32-
*
3331
*/
3432
public class ElfBlacksmith implements Blacksmith {
3533

3634
private static Map<WeaponType, ElfWeapon> ELFARSENAL;
35+
3736
static {
38-
ELFARSENAL= new HashMap<>(WeaponType.values().length);
39-
for (WeaponType type : WeaponType.values()) {
40-
ELFARSENAL.put(type, new ElfWeapon(type));
41-
}
37+
ELFARSENAL = new HashMap<>(WeaponType.values().length);
38+
for (WeaponType type : WeaponType.values()) {
39+
ELFARSENAL.put(type, new ElfWeapon(type));
40+
}
4241
}
4342

4443
@Override

factory-method/src/main/java/com/iluwatar/factory/method/OrcBlacksmith.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,17 @@
2727
import java.util.Map;
2828

2929
/**
30-
*
3130
* Concrete subclass for creating new objects.
32-
*
3331
*/
3432
public class OrcBlacksmith implements Blacksmith {
3533

3634
private static Map<WeaponType, OrcWeapon> ORCARSENAL;
35+
3736
static {
38-
ORCARSENAL= new HashMap<>(WeaponType.values().length);
39-
for (WeaponType type : WeaponType.values()) {
40-
ORCARSENAL.put(type, new OrcWeapon(type));
41-
}
37+
ORCARSENAL = new HashMap<>(WeaponType.values().length);
38+
for (WeaponType type : WeaponType.values()) {
39+
ORCARSENAL.put(type, new OrcWeapon(type));
40+
}
4241
}
4342

4443
@Override

factory-method/src/main/java/com/iluwatar/factory/method/WeaponType.java

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

2626
/**
27-
*
28-
* WeaponType enumeration
29-
*
27+
* WeaponType enumeration.
3028
*/
3129
public enum WeaponType {
3230

0 commit comments

Comments
 (0)