Code cleanup (#1461)
* Code cleanup * Fix flux tests * Fix checkstyle errors * Fix compile error
This commit is contained in:
@ -32,7 +32,7 @@ import java.util.Map;
|
||||
*/
|
||||
public class ElfBlacksmith implements Blacksmith {
|
||||
|
||||
private static Map<WeaponType, ElfWeapon> ELFARSENAL;
|
||||
private static final Map<WeaponType, ElfWeapon> ELFARSENAL;
|
||||
|
||||
static {
|
||||
ELFARSENAL = new HashMap<>(WeaponType.values().length);
|
||||
|
@ -28,7 +28,7 @@ package com.iluwatar.factory.method;
|
||||
*/
|
||||
public class ElfWeapon implements Weapon {
|
||||
|
||||
private WeaponType weaponType;
|
||||
private final WeaponType weaponType;
|
||||
|
||||
public ElfWeapon(WeaponType weaponType) {
|
||||
this.weaponType = weaponType;
|
||||
|
@ -32,7 +32,7 @@ import java.util.Map;
|
||||
*/
|
||||
public class OrcBlacksmith implements Blacksmith {
|
||||
|
||||
private static Map<WeaponType, OrcWeapon> ORCARSENAL;
|
||||
private static final Map<WeaponType, OrcWeapon> ORCARSENAL;
|
||||
|
||||
static {
|
||||
ORCARSENAL = new HashMap<>(WeaponType.values().length);
|
||||
|
@ -28,7 +28,7 @@ package com.iluwatar.factory.method;
|
||||
*/
|
||||
public class OrcWeapon implements Weapon {
|
||||
|
||||
private WeaponType weaponType;
|
||||
private final WeaponType weaponType;
|
||||
|
||||
public OrcWeapon(WeaponType weaponType) {
|
||||
this.weaponType = weaponType;
|
||||
|
@ -30,7 +30,7 @@ public enum WeaponType {
|
||||
|
||||
SHORT_SWORD("short sword"), SPEAR("spear"), AXE("axe"), UNDEFINED("");
|
||||
|
||||
private String title;
|
||||
private final String title;
|
||||
|
||||
WeaponType(String title) {
|
||||
this.title = title;
|
||||
|
Reference in New Issue
Block a user