Skip to content

Commit

Permalink
👕 Fix checkstyle
Browse files Browse the repository at this point in the history
  • Loading branch information
germanattanasio committed Mar 24, 2017
1 parent 60e80de commit 9a7654b
Show file tree
Hide file tree
Showing 12 changed files with 61 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public class Concept extends GenericModel {

/** The knowledge graph. */
private KnowledgeGraph knowledgeGraph;

/**
* Gets the knowledge graph.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ public void onError(Exception e) {
public void onDisconnected() { };

/* (non-Javadoc)
* @see com.ibm.watson.developer_cloud.speech_to_text.v1.websocket.RecognizeCallback#onInactivityTimeout(java.lang.RuntimeException)
* @see com.ibm.watson.developer_cloud.speech_to_text.v1.websocket
* .RecognizeCallback#onInactivityTimeout(java.lang.RuntimeException)
*/
@Override
public void onInactivityTimeout(RuntimeException runtimeException) { };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,9 @@ public void onTranscription(SpeechResults speechResults) {
assertNotNull(wordAlternatives.get(0).getAlternatives());
}


/**
* Test the inactivity timeout parameter for WebSockets
* Test the inactivity timeout parameter for WebSockets.
*
* @throws FileNotFoundException the file not found exception
* @throws InterruptedException the interrupted exception
Expand All @@ -331,7 +331,7 @@ public void testInactivityTimeoutWithWebSocket() throws FileNotFoundException, I
.model(EN_BROADBAND16K)
.contentType(HttpMediaType.AUDIO_WAV)
.build();

FileInputStream audio = new FileInputStream(SAMPLE_WAV_WITH_PAUSE);
service.recognizeUsingWebSocket(audio, options, new BaseRecognizeCallback() {

Expand All @@ -345,7 +345,7 @@ public void onError(Exception e) {
e.printStackTrace();
lock.countDown();
}

@Override
public void onInactivityTimeout(RuntimeException runtimeException) {
inactivityTimeoutOccurred = true;
Expand All @@ -356,7 +356,7 @@ public void onInactivityTimeout(RuntimeException runtimeException) {
assertTrue(inactivityTimeoutOccurred);
}


/**
* Test create recognition job.
*
Expand Down Expand Up @@ -553,8 +553,10 @@ public void testGetWord() {
@Test
public void testCustomization() throws InterruptedException {
// create customization
Customization myCustomization =
service.createCustomization("java-sdk-temporary", SpeechModel.EN_US_BROADBANDMODEL, "Temporary custom model for testing the Java SDK").execute();
Customization myCustomization = service.createCustomization("java-sdk-temporary",
SpeechModel.EN_US_BROADBANDMODEL,
"Temporary custom model for testing the Java SDK")
.execute();
String id = myCustomization.getId();

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,10 @@ public void testCreateRecognitionJob() throws InterruptedException, FileNotFound
String id = "foo";
RecognitionJob job = loadFixture("src/test/resources/speech_to_text/job.json", RecognitionJob.class);

server.enqueue(new MockResponse().addHeader(CONTENT_TYPE, HttpMediaType.APPLICATION_JSON).setBody(GSON.toJson(job)));
server.enqueue(new MockResponse()
.addHeader(CONTENT_TYPE, HttpMediaType.APPLICATION_JSON)
.setBody(GSON.toJson(job))
);

RecognitionJob result = service.getRecognitionJob(id).execute();
final RecordedRequest request = server.takeRequest();
Expand All @@ -409,7 +412,10 @@ public void testGetRecognitionJob() throws InterruptedException, FileNotFoundExc
String id = "foo";
RecognitionJob job = loadFixture("src/test/resources/speech_to_text/job.json", RecognitionJob.class);

server.enqueue(new MockResponse().addHeader(CONTENT_TYPE, HttpMediaType.APPLICATION_JSON).setBody(GSON.toJson(job)));
server.enqueue(new MockResponse()
.addHeader(CONTENT_TYPE, HttpMediaType.APPLICATION_JSON)
.setBody(GSON.toJson(job))
);

RecognitionJob result = service.getRecognitionJob(id).execute();
final RecordedRequest request = server.takeRequest();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@
import com.ibm.watson.developer_cloud.text_to_speech.v1.model.Phoneme;
import com.ibm.watson.developer_cloud.text_to_speech.v1.model.Pronunciation;
import com.ibm.watson.developer_cloud.text_to_speech.v1.model.Voice;
import com.ibm.watson.developer_cloud.util.*;
import com.ibm.watson.developer_cloud.util.GsonSingleton;
import com.ibm.watson.developer_cloud.util.RequestUtils;
import com.ibm.watson.developer_cloud.util.ResponseConverterUtils;
import com.ibm.watson.developer_cloud.util.ResponseUtils;
import com.ibm.watson.developer_cloud.util.Validator;

import okhttp3.Request;
import okhttp3.RequestBody;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;

import java.util.List;

Expand Down Expand Up @@ -124,7 +124,9 @@ public void testGetVoiceCustomization() throws InterruptedException {
final Voice result = service.getVoice(expected.getName(), expected.getCustomVoiceModel().getId()).execute();
final RecordedRequest request = server.takeRequest();

assertEquals(VOICES_PATH + "/" + expected.getName() + "?customization_id=" + expected.getCustomVoiceModel().getId(), request.getPath());
assertEquals(VOICES_PATH + "/" + expected.getName() + "?customization_id=" + expected.getCustomVoiceModel().getId(),
request.getPath()
);
assertEquals("GET", request.getMethod());
assertEquals(expected, result);
}
Expand Down Expand Up @@ -211,7 +213,9 @@ public void testCreateVoiceModel() throws InterruptedException {
final CustomVoiceModel expected = instantiateVoiceModel();
server.enqueue(jsonResponse(ImmutableMap.of(ID, expected.getId())));

final CustomVoiceModel result = service.createCustomVoiceModel(expected.getName(), expected.getLanguage(), expected.getDescription()).execute();
final CustomVoiceModel result = service.createCustomVoiceModel(expected.getName(),
expected.getLanguage(), expected.getDescription())
.execute();
final RecordedRequest request = server.takeRequest();

assertEquals(VOICE_MODELS_PATH, request.getPath());
Expand Down Expand Up @@ -243,7 +247,10 @@ public void testUpdateVoiceModel() throws InterruptedException {
final CustomVoiceModel expected = instantiateVoiceModel();
server.enqueue(jsonResponse(ImmutableMap.of(ID, expected.getId())));

final CustomVoiceModel result = service.createCustomVoiceModel(expected.getId(), expected.getName(), expected.getDescription()).execute();
final CustomVoiceModel result = service.createCustomVoiceModel(
expected.getId(), expected.getName(), expected.getDescription())
.execute();

final RecordedRequest request = server.takeRequest();
assertEquals(expected.getId(), result.getId());

Expand Down Expand Up @@ -279,7 +286,9 @@ public void testUpdateVoiceModelWords() throws InterruptedException {
final CustomVoiceModel expected = instantiateVoiceModelWords();
server.enqueue(jsonResponse(ImmutableMap.of(ID, expected.getId())));

final CustomVoiceModel result = service.createCustomVoiceModel(expected.getId(), expected.getName(), expected.getDescription()).execute();
final CustomVoiceModel result = service.createCustomVoiceModel(expected.getId(),
expected.getName(), expected.getDescription())
.execute();
final RecordedRequest request = server.takeRequest();
assertEquals(expected.getId(), result.getId());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public TradeoffAnalytics(String username, String password) {
* @return the dilemma
*/
public ServiceCall<Dilemma> dilemmas(final Problem problem) {
return dilemmas(problem, null, null);
return dilemmas(problem, null, null);
}

/**
Expand All @@ -102,10 +102,10 @@ public ServiceCall<Dilemma> dilemmas(final Problem problem) {
* @return the decision problem
*/
public ServiceCall<Dilemma> dilemmas(final Problem problem, final Boolean generateVisualization) {
return dilemmas(problem, generateVisualization, null);

return dilemmas(problem, generateVisualization, null);
}

/**
* Returns a dilemma that contains the {@link Problem} and a {@link Resolution}. The {@link Problem} contains a set of
* options and objectives. The {@link Resolution} contains a set of optimal options, their analytical characteristics,
Expand All @@ -126,18 +126,18 @@ public ServiceCall<Dilemma> dilemmas(final Problem problem, final Boolean genera
* that will most likely satisfy the greatest number of users.
* @return the decision problem
*/

public ServiceCall<Dilemma> dilemmas(
final Problem problem,
final Boolean generateVisualization,
final Boolean findPreferableOptions) {
final Problem problem,
final Boolean generateVisualization,
final Boolean findPreferableOptions) {
Validator.notNull(problem, "problem was not specified");

final String contentJson = GsonSingleton.getGsonWithoutPrettyPrinting().toJson(problem);

final RequestBuilder requestBuilder =
RequestBuilder.post(PATH_DILEMMAS).bodyContent(contentJson, HttpMediaType.APPLICATION_JSON);

List<String> queryParams = new ArrayList<>();
if (generateVisualization != null) {
queryParams.add(GENERATE_VISUALIZATION);
Expand All @@ -147,9 +147,9 @@ public ServiceCall<Dilemma> dilemmas(
queryParams.add(FIND_PREFERABLE_OPTIONS);
queryParams.add(findPreferableOptions.toString());
}

requestBuilder.query(queryParams.toArray());

return createServiceCall(requestBuilder.build(), ResponseConverterUtils.getObject(Dilemma.class));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public String getSolutionKey() {
public List<ObjectiveDominationData> getObjectives() {
return objectives;
}

/**
* Sets the solution key.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public String getObjectiveKey() {
public Double getDifference() {
return difference;
}

/**
* Gets the textual explanation of the difference.
*
Expand All @@ -47,7 +47,7 @@ public Double getDifference() {
public String getText() {
return text;
}

/**
* Sets the objective key.
*
Expand All @@ -65,7 +65,7 @@ public void setObjectiveKey(String key) {
public void setDifference(Double difference) {
this.difference = difference;
}

/**
* Sets the textual explanation.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public List<String> getSolutionKeys() {
public Double getScore() {
return score;
}

/**
* Sets the solution keys.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class Resolution extends GenericModel {
private ResolutionMap map;

private List<Solution> solutions;

@SerializedName("preferable_solutions")
private PreferableSolutions preferableSolutions;

Expand All @@ -48,7 +48,7 @@ public ResolutionMap getMap() {
public List<Solution> getSolutions() {
return solutions;
}

/**
* Gets the preferable solutions.
*
Expand Down Expand Up @@ -84,5 +84,5 @@ public void setSolutions(List<Solution> solutions) {
public void setPreferableSolutions(PreferableSolutions solutions) {
this.preferableSolutions = solutions;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public void setTokens(List<String> tokens) {

@SerializedName("status_cause")
private StatusCause statusCause;

@SerializedName("excluded_by")
private List<DominatingOption> excludedBy;

Expand Down Expand Up @@ -162,7 +162,7 @@ public StatusCause getStatusCause() {
public List<DominatingOption> getExcludedBy() {
return excludedBy;
}

/**
* Sets the shadow me.
*
Expand Down Expand Up @@ -207,7 +207,7 @@ public void setStatus(String status) {
public void setStatusCause(StatusCause statusCause) {
this.statusCause = statusCause;
}

/**
* Sets the list of excluding options.
*
Expand Down

0 comments on commit 9a7654b

Please sign in to comment.