Skip to content

Commit 205eaa3

Browse files
committed
Minor code improvements
1 parent 6c0d3c1 commit 205eaa3

2 files changed

Lines changed: 8 additions & 9 deletions

File tree

src/main/java/ch/unibas/dmi/dbis/chronos/agent/AbstractChronosAgent.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ protected String getEnvironment() {
348348
*/
349349
protected Properties executePhases( final ChronosJob job, final File inputDirectory, final File outputDirectory ) throws ExecutionException {
350350

351-
long startTime = 0L;
351+
long startTime;
352352
final Properties results = new Properties();
353353

354354
final Object preparePhaseData;
@@ -627,7 +627,7 @@ protected void removeChronosLogHandler( final ChronosHttpClient.ChronosLogHandle
627627

628628

629629
/**
630-
* Watches if the job to observe is aborted/canceled at the Chronos Web Site.
630+
* Watches if the job to observe is aborted/canceled at the Chronos website.
631631
* The job's state is fetched every 10 seconds (default) and compared against ABORTED
632632
*/
633633
private class AbortedMonitor {
@@ -637,7 +637,7 @@ private class AbortedMonitor {
637637

638638

639639
/**
640-
* Calls the observe(ChronosJob, long) method with the default sleeping time.
640+
* Calls the <code>observe(ChronosJob, long)</code> method with the default sleeping time.
641641
*
642642
* @see #observe(ChronosJob, long)
643643
* @see AbstractChronosAgent#SLEEPING_TIME_VALUE

src/main/java/ch/unibas/dmi/dbis/chronos/agent/ChronosHttpClient.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -640,6 +640,7 @@ private String getUrl( final InetAddress address, final int port, final ChronosR
640640
if ( this.secure ) {
641641
url.append( "https://" );
642642
} else {
643+
//noinspection HttpUrlsUsage
643644
url.append( "http://" );
644645
}
645646
if ( this.useHostname ) {
@@ -838,7 +839,7 @@ public final class ChronosLogHandler {
838839
private final Properties query;
839840
private final Map<String, Object> parameters;
840841

841-
AtomicInteger sequenceNumber = new AtomicInteger();
842+
final AtomicInteger sequenceNumber = new AtomicInteger();
842843

843844

844845
public ChronosLogHandler( final ChronosJob job ) {
@@ -865,11 +866,9 @@ public void publish( String message ) {
865866
final JSONObject status = jsonResponse.getJSONObject( ChronosRestApi.STATUS_OBJECT_KEY );
866867

867868
if ( status.getInt( ChronosRestApi.STATUS_CODE_KEY ) != ChronosRestApi.STATUS_CODE__SUCCESS ) {
868-
log.warn( "Service returned: {0}: {1}",
869-
new Object[]{
870-
status.getInt( ChronosRestApi.STATUS_CODE_KEY ),
871-
status.getString( ChronosRestApi.STATUS_MESSAGE_KEY )
872-
} );
869+
log.warn( "Service returned: {}: {}",
870+
status.getInt( ChronosRestApi.STATUS_CODE_KEY ),
871+
status.getString( ChronosRestApi.STATUS_MESSAGE_KEY ) );
873872
}
874873
} catch ( UnirestException ex ) {
875874
log.warn( "Exception while publishing log records.", ex );

0 commit comments

Comments
 (0)