From 3634b3338cc2fab6cfa147c9475b986165471b73 Mon Sep 17 00:00:00 2001 From: Tschis Date: Tue, 7 Nov 2017 22:19:10 -0300 Subject: [PATCH] Fix checkstyle validations --- .../com/iluwatar/abstractfactory/App.java | 45 +++++++++---------- .../abstractfactory/AbstractFactoryTest.java | 6 +-- 2 files changed, 25 insertions(+), 26 deletions(-) diff --git a/abstract-factory/src/main/java/com/iluwatar/abstractfactory/App.java b/abstract-factory/src/main/java/com/iluwatar/abstractfactory/App.java index 663018588..4cc1bcc0d 100644 --- a/abstract-factory/src/main/java/com/iluwatar/abstractfactory/App.java +++ b/abstract-factory/src/main/java/com/iluwatar/abstractfactory/App.java @@ -95,33 +95,32 @@ public class App { this.army = army; } - /** - * The factory of kingdom factories. - */ public static class FactoryMaker { - - private FactoryMaker() {} - - public enum KingdomType { - ELF, - ORC - } - - public static KingdomFactory makeFactory(KingdomType type) { - switch (type) { - case ELF: - return new ElfKingdomFactory(); - case ORC: - return new OrcKingdomFactory(); - default: - throw new IllegalArgumentException("KingdomType not supported."); - } - } + private FactoryMaker() { + } + + public enum KingdomType { + ELF, ORC + } + + /** + * The factory of kingdom factories. + */ + public static KingdomFactory makeFactory(KingdomType type) { + switch (type) { + case ELF: + return new ElfKingdomFactory(); + case ORC: + return new OrcKingdomFactory(); + default: + throw new IllegalArgumentException("KingdomType not supported."); + } + } } - + /** - * Program entry point + * Program entry point. * * @param args * command line args diff --git a/abstract-factory/src/test/java/com/iluwatar/abstractfactory/AbstractFactoryTest.java b/abstract-factory/src/test/java/com/iluwatar/abstractfactory/AbstractFactoryTest.java index 67ecd43f4..7613edf65 100644 --- a/abstract-factory/src/test/java/com/iluwatar/abstractfactory/AbstractFactoryTest.java +++ b/abstract-factory/src/test/java/com/iluwatar/abstractfactory/AbstractFactoryTest.java @@ -25,12 +25,12 @@ package com.iluwatar.abstractfactory; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; -import org.junit.Before; -import org.junit.Test; - import com.iluwatar.abstractfactory.App.FactoryMaker; import com.iluwatar.abstractfactory.App.FactoryMaker.KingdomType; +import org.junit.Before; +import org.junit.Test; + /** * Test for abstract factory */