Skip to content

Commit

Permalink
addressed the code review requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
simonjenga committed Dec 31, 2015
1 parent 1811316 commit 6f0c6d9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ public void execute() throws MojoFailureException {
Logger.info(this, "execution skipped because of 'skip' option");
return;
}
// @checkstyle Always make this.environment(); as the first call!
this.environment();
this.run(AbstractDynamoMojo.INSTANCES);
}
Expand Down Expand Up @@ -125,9 +124,9 @@ protected List<String> args() {
* Set the project environment.
* {@link com.jcabi.dynamodb.maven.plugin.AbstractEnviromentMojo}.
* @throws MojoFailureException If fails
* @checkstyle Intentionally empty!, To be implemented by sub classes!
*/
protected void environment() throws MojoFailureException {
// @checkstyle Intentionally empty!, To be implemented by sub classes!
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,14 @@ public void environment() throws MojoFailureException {
);
}
if (this.home == null) {
this.home = new File(System.getProperty("java.home"));
try {
this.home = new File(System.getProperty("java.home"));
// @checkstyle IllegalCatch (1 line)
} catch (final Exception ex) {
throw new MojoFailureException(
String.format("Java home property not set: %s", this.home)
);
}
}
if (!this.home.exists()) {
throw new MojoFailureException(
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/jcabi/dynamodb/maven/plugin/Instances.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@
* @since 0.1
* @checkstyle ClassDataAbstractionCoupling (500 lines)
* @see <a href="http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Tools.html">DynamoDB Local</a>
* @todo #44:30min Let's avoid code duplication between
* {@link #run(File, int, File, List)} & {@link #start(File, int, File, List)}
* A proper distinction between these two methods needs to be implemented.
*/
@ToString
@EqualsAndHashCode(of = "processes")
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/com/jcabi/dynamodb/maven/plugin/RunMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@
* @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 Down

0 comments on commit 6f0c6d9

Please sign in to comment.