Adjust checkstyle rules. Make checkstyle fail the build when violations are found. Correct all current checkstyle violations.

This commit is contained in:
Ilkka Seppala
2015-12-25 23:49:28 +02:00
parent 9fbb085985
commit cec9a99410
167 changed files with 1242 additions and 969 deletions
abstract-factory/src/main/java/com/iluwatar/abstractfactory
async-method-invocation/src
main
java
com
test
java
com
iluwatar
async
builder/src/main/java/com/iluwatar/builder
business-delegate/src/main/java/com/iluwatar/business/delegate
caching/src
callback/src/main/java/com/iluwatar/callback
chain/src/main/java/com/iluwatar/chain
checkstyle.xml
command/src/main/java/com/iluwatar/command
composite/src/main/java/com/iluwatar/composite
dao/src/main
java
com
resources
double-checked-locking/src
main
java
com
iluwatar
doublechecked
test
java
com
iluwatar
doublechecked
double-dispatch/src
main
java
com
iluwatar
test
java
com
iluwatar
doubledispatch
event-aggregator/src/test/java/com/iluwatar/event/aggregator
execute-around/src
main
java
com
iluwatar
test
java
com
iluwatar
facade/src/main/java/com/iluwatar/facade
fluentinterface/src
main
java
com
iluwatar
fluentinterface
test
java
com
iluwatar
fluentinterface
flux/src/main/java/com/iluwatar/flux/dispatcher
flyweight/src/main/java/com/iluwatar/flyweight
front-controller/src
half-sync-half-async/src/main/java/com/iluwatar/halfsynchalfasync
intercepting-filter/src
main
test
java
com
iluwatar
intercepting
interpreter/src
main
java
com
iluwatar
interpreter
test
java
com
iluwatar
iterator/src
main
test
java
com
iluwatar
layers/src/main
lazy-loading/src/main/java/com/iluwatar/lazy/loading
memento/src/main/java/com/iluwatar/memento
message-channel/src/main/java/com/iluwatar/message/channel
model-view-presenter/src
main
test
java
com
iluwatar
monostate/src/main/java/com/iluwatar/monostate
naked-objects
dom
src
main
java
domainapp
dom
fixture
src
main
java
domainapp
integtests
webapp
src
main
java
domainapp
null-object/src/main/java/com/iluwatar/nullobject
object-pool/src/main/java/com/iluwatar/object/pool
observer/src/main/java/com/iluwatar/observer
poison-pill/src/main/java/com/iluwatar/poison/pill
pom.xml
private-class-data/src/main/java/com/iluwatar/privateclassdata
producer-consumer/src/main/java/com/iluwatar/producer/consumer
property/src/main/java/com/iluwatar/property
prototype/src/main/java/com/iluwatar/prototype
proxy/src/main/java/com/iluwatar/proxy
publish-subscribe/src/main/java/com/iluwatar/publish/subscribe
reactor/src/main/java/com/iluwatar/reactor
repository/src
resource-acquisition-is-initialization/src/main/java/com/iluwatar/resource/acquisition/is/initialization
servant/src/main/java/com/iluwatar/servant
service-layer/src/main/java/com/iluwatar/servicelayer
service-locator/src/main/java/com/iluwatar/servicelocator
singleton/src
specification/src/main/java/com/iluwatar/specification
state/src/main/java/com/iluwatar/state
step-builder/src/main/java/com/iluwatar/stepbuilder
template-method/src/main/java/com/iluwatar/templatemethod
tolerant-reader/src/main/java/com/iluwatar/tolerantreader
twin/src/main/java/com/iluwatar/twin
visitor/src/main/java/com/iluwatar/visitor

@@ -1,20 +1,18 @@
package com.iluwatar.abstractfactory;
/**
*
* The Abstract Factory pattern provides a way to encapsulate a group of individual factories that
* have a common theme without specifying their concrete classes. In normal usage, the client
* software creates a concrete implementation of the abstract factory and then uses the generic
* interface of the factory to create the concrete objects that are part of the theme. The client
* does not know (or care) which concrete objects it gets from each of these internal factories,
* since it uses only the generic interfaces of their products. This pattern separates the details
* of implementation of a set of objects from their general usage and relies on object composition,
* as object creation is implemented in methods exposed in the factory interface.
* The Abstract Factory pattern provides a way to encapsulate a group of individual factories that have a common theme
* without specifying their concrete classes. In normal usage, the client software creates a concrete implementation of
* the abstract factory and then uses the generic interface of the factory to create the concrete objects that are part
* of the theme. The client does not know (or care) which concrete objects it gets from each of these internal
* factories, since it uses only the generic interfaces of their products. This pattern separates the details of
* implementation of a set of objects from their general usage and relies on object composition, as object creation is
* implemented in methods exposed in the factory interface.
* <p>
* The essence of the Abstract Factory pattern is a factory interface ({@link KingdomFactory}) and
* its implementations ({@link ElfKingdomFactory}, {@link OrcKingdomFactory}). The example uses both
* concrete implementations to create a king, a castle and an army.
* The essence of the Abstract Factory pattern is a factory interface ({@link KingdomFactory}) and its implementations (
* {@link ElfKingdomFactory}, {@link OrcKingdomFactory}). The example uses both concrete implementations to create a
* king, a castle and an army.
*
*/
public class App {
@@ -23,11 +21,8 @@ public class App {
private Castle castle;
private Army army;
/**
* Creates kingdom
*
* @param factory
*/
public void createKingdom(final KingdomFactory factory) {
setKing(factory.createKing());
@@ -47,14 +42,6 @@ public class App {
return factory.createKing();
}
Castle getCastle(final KingdomFactory factory) {
return factory.createCastle();
}
Army getArmy(final KingdomFactory factory) {
return factory.createArmy();
}
public King getKing() {
return king;
}
@@ -62,6 +49,10 @@ public class App {
private void setKing(final King king) {
this.king = king;
}
Castle getCastle(final KingdomFactory factory) {
return factory.createCastle();
}
public Castle getCastle() {
return castle;
@@ -70,6 +61,10 @@ public class App {
private void setCastle(final Castle castle) {
this.castle = castle;
}
Army getArmy(final KingdomFactory factory) {
return factory.createArmy();
}
public Army getArmy() {
return army;
@@ -79,32 +74,32 @@ public class App {
this.army = army;
}
/**
* Program entry point
*
* @param args command line args
* @param args
* command line args
*/
public static void main(String[] args) {
App app = new App();
System.out.println("Elf Kingdom");
KingdomFactory elfKingdomFactory;
elfKingdomFactory = app.getElfKingdomFactory();
app.createKingdom(elfKingdomFactory);
System.out.println(app.getArmy().getDescription());
System.out.println(app.getCastle().getDescription());
System.out.println(app.getKing().getDescription());
System.out.println("\nOrc Kingdom");
KingdomFactory orcKingdomFactory;
orcKingdomFactory = app.getOrcKingdomFactory();
app.createKingdom(orcKingdomFactory);
System.out.println(app.getArmy().getDescription());
System.out.println(app.getCastle().getDescription());
System.out.println(app.getKing().getDescription());
App app = new App();
System.out.println("Elf Kingdom");
KingdomFactory elfKingdomFactory;
elfKingdomFactory = app.getElfKingdomFactory();
app.createKingdom(elfKingdomFactory);
System.out.println(app.getArmy().getDescription());
System.out.println(app.getCastle().getDescription());
System.out.println(app.getKing().getDescription());
System.out.println("\nOrc Kingdom");
KingdomFactory orcKingdomFactory;
orcKingdomFactory = app.getOrcKingdomFactory();
app.createKingdom(orcKingdomFactory);
System.out.println(app.getArmy().getDescription());
System.out.println(app.getCastle().getDescription());
System.out.println(app.getKing().getDescription());
}
}