Skip to content

Commit

Permalink
removed redundant catch block in try statement (#383)
Browse files Browse the repository at this point in the history
  • Loading branch information
szk495732563 authored and WillemJiang committed Dec 9, 2017
1 parent 8ac5031 commit cb075f9
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import org.mockito.Mockito;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.ObjectCodec;
import com.fasterxml.jackson.core.io.IOContext;
import com.fasterxml.jackson.databind.SerializerProvider;
Expand Down Expand Up @@ -121,8 +120,6 @@ public void writeEndObject() throws IOException {
paramSerializer.serialize(stringArray,
obj,
Mockito.mock(SerializerProvider.class));
} catch (JsonProcessingException e) {
status = false;
} catch (IOException e) {
status = false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import org.mockito.Mockito;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.ObjectCodec;
import com.fasterxml.jackson.core.io.IOContext;
import com.fasterxml.jackson.databind.SerializerProvider;
Expand Down Expand Up @@ -121,8 +120,6 @@ public void writeEndObject() throws IOException {
resultSerializer.serialize(stringArray,
obj,
Mockito.mock(SerializerProvider.class));
} catch (JsonProcessingException e) {
status = false;
} catch (IOException e) {
status = false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,6 @@ public void writeValue(OutputStream out,
try {
StandardObjectWriter.writeValue(outputStream,
stringArray);
} catch (JsonGenerationException e) {
status = false;
} catch (JsonMappingException e) {
status = false;
} catch (IOException e) {
status = false;
}
Expand Down
3 changes: 0 additions & 3 deletions core/src/test/java/io/servicecomb/core/TestConsumer.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ public void testConsumerProviderManager() {
boolean validAssert = true;
try {
oConsumerProviderManager.getReferenceConfig("consumer provider manager");
} catch (Exception e) {
Assert.assertNotEquals(null, e);
validAssert = false;
} catch (Throwable ee) {
Assert.assertNotEquals(null, ee);
validAssert = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,12 @@ public void testAll() {
lCseHttpMessageConverter.getSupportedMediaTypes();
try {
lCseHttpMessageConverter.read(this.getClass(), null);
} catch (HttpMessageNotReadableException e) {
} catch (IOException e) {
} catch (HttpMessageNotReadableException | IOException ignored) {
}
try {
HttpOutputMessage httpOutputMessage = Mockito.mock(CseClientHttpRequest.class);
lCseHttpMessageConverter.write(null, null, httpOutputMessage);
} catch (HttpMessageNotWritableException | IOException e) {
} catch (HttpMessageNotWritableException | IOException ignored) {
}

Assert.assertEquals(true, lCseHttpMessageConverter.canRead(null, null));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ public void testcontextInitializedException() {

try {
listener.contextInitialized(sce);
} catch (Exception e) {
status = false;
} catch (Error e) {
} catch (Exception | Error e) {
status = false;
}
Assert.assertFalse(status);
Expand Down

0 comments on commit cb075f9

Please sign in to comment.