Skip to content

Commit

Permalink
renamed the methods and removed the constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
simonjenga committed Dec 30, 2015
1 parent 3ee5333 commit 1811316
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ protected List<String> args() {
* @throws MojoFailureException If fails
*/
protected void environment() throws MojoFailureException {
// Intentionally empty!, To be implemented by sub classes.
// @checkstyle Intentionally empty!, To be implemented by sub classes!
return;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,18 @@ public void environment() throws MojoFailureException {
}

/**
* Dist file.
* Location of DynamoDB Local distribution.
* @return File dist
*/
protected File dist() {
protected File distdir() {
return this.dist;
}

/**
* Home file.
* Java home directory, where "bin/java" can be executed.
* @return File home
*/
protected File home() {
protected File homedir() {
return this.home;
}
}
16 changes: 4 additions & 12 deletions src/main/java/com/jcabi/dynamodb/maven/plugin/RunMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,13 @@
/**
* Runs DynamoDB Local.
*
* @todo #41:30min Let's avoid code duplication between this class and `StartMojo`.
* One idea is to create a decorator called `ThreadedMojo` that receives
* another mojo in its constructor and, when called, runs it inside a thread.
*
* @author Denis N. Antonioli (denisa@sunrun.com)
* @author Simon Njenga (simtuje@gmail.com)
* @version $Id$
* @since 0.8
* @todo #41:30min Let's avoid code duplication between this class and `StartMojo`.
* One idea is to create a decorator called `ThreadedMojo` that receives
* another mojo in its constructor and, when called, runs it inside a thread.
*/
@ToString
@EqualsAndHashCode(callSuper = false)
Expand All @@ -56,18 +55,11 @@
)
public final class RunMojo extends AbstractEnviromentMojo {

/**
* Ctor.
*/
public RunMojo() {
super();
}

@Override
public void run(final Instances instances) throws MojoFailureException {
try {
instances.start(
this.dist(), this.tcpPort(), this.home(), this.args()
this.distdir(), this.tcpPort(), this.homedir(), this.args()
);
} catch (final IOException ex) {
throw new MojoFailureException(
Expand Down
9 changes: 1 addition & 8 deletions src/main/java/com/jcabi/dynamodb/maven/plugin/StartMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,11 @@
)
public final class StartMojo extends AbstractEnviromentMojo {

/**
* Ctor.
*/
public StartMojo() {
super();
}

@Override
public void run(final Instances instances) throws MojoFailureException {
try {
instances.start(
this.dist(), this.tcpPort(), this.home(), this.args()
this.distdir(), this.tcpPort(), this.homedir(), this.args()
);
} catch (final IOException ex) {
throw new MojoFailureException(
Expand Down

0 comments on commit 1811316

Please sign in to comment.