Skip to content

Commit 9d61b39

Browse files
committed
Remove final from catch clauses
1 parent d3008cc commit 9d61b39

File tree

8 files changed

+10
-10
lines changed

8 files changed

+10
-10
lines changed

bson/src/main/org/bson/codecs/pojo/CollectionPropertyCodecProvider.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ private Collection<T> getInstance() {
9696

9797
try {
9898
return encoderClass.getDeclaredConstructor().newInstance();
99-
} catch (final Exception e) {
99+
} catch (Exception e) {
100100
throw new CodecConfigurationException(e.getMessage(), e);
101101
}
102102
}

bson/src/main/org/bson/codecs/pojo/DiscriminatorLookup.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ private Class<?> getClassForName(final String discriminator) {
6565
Class<?> clazz = null;
6666
try {
6767
clazz = Class.forName(discriminator);
68-
} catch (final ClassNotFoundException e) {
68+
} catch (ClassNotFoundException e) {
6969
// Ignore
7070
}
7171
return clazz;

bson/src/main/org/bson/codecs/pojo/MapPropertyCodecProvider.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ private Map<String, T> getInstance() {
107107
}
108108
try {
109109
return encoderClass.getDeclaredConstructor().newInstance();
110-
} catch (final Exception e) {
110+
} catch (Exception e) {
111111
throw new CodecConfigurationException(e.getMessage(), e);
112112
}
113113
}

bson/src/main/org/bson/codecs/pojo/PropertyAccessorImpl.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public <S> T get(final S instance) {
4141
} else {
4242
throw getError(null);
4343
}
44-
} catch (final Exception e) {
44+
} catch (Exception e) {
4545
throw getError(e);
4646
}
4747
}
@@ -56,7 +56,7 @@ public <S> void set(final S instance, final T value) {
5656
propertyMetadata.getField().set(instance, value);
5757
}
5858
}
59-
} catch (final Exception e) {
59+
} catch (Exception e) {
6060
throw setError(e);
6161
}
6262
}

bson/src/main/org/bson/json/JsonStreamBuffer.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public int read() {
8888
}
8989
return nextChar;
9090

91-
} catch (final IOException e) {
91+
} catch (IOException e) {
9292
throw new JsonParseException(e);
9393
}
9494
}

bson/src/test/unit/org/bson/json/JsonReaderTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1308,7 +1308,7 @@ private void testStringAndStream(final String json, final Function<AbstractBsonR
13081308
final Class<? extends RuntimeException> exClass) {
13091309
try {
13101310
testFunc.apply(new JsonReader(json));
1311-
} catch (final Exception e) {
1311+
} catch (Exception e) {
13121312
if (exClass == null) {
13131313
throw e;
13141314
}
@@ -1317,7 +1317,7 @@ private void testStringAndStream(final String json, final Function<AbstractBsonR
13171317
try {
13181318
testFunc.apply(new JsonReader(new InputStreamReader(new ByteArrayInputStream(json.getBytes(StandardCharsets.UTF_8)),
13191319
StandardCharsets.UTF_8)));
1320-
} catch (final Exception e) {
1320+
} catch (Exception e) {
13211321
if (exClass == null) {
13221322
throw e;
13231323
}

driver-core/src/main/com/mongodb/connection/netty/NettyStream.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ public void run() {
581581
ctx.fireExceptionCaught(ReadTimeoutException.INSTANCE);
582582
ctx.close();
583583
}
584-
} catch (final Throwable t) {
584+
} catch (Throwable t) {
585585
ctx.fireExceptionCaught(t);
586586
}
587587
}

driver-sync/src/test/functional/com/mongodb/client/ChangeStreamProseTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ static class ChangeStreamWatcher implements Runnable {
7676
public void run() {
7777
try {
7878
cursor.next();
79-
} catch (final MongoInterruptedException e) {
79+
} catch (MongoInterruptedException e) {
8080
interruptedExceptionOccurred = true;
8181
} finally {
8282
cursor.close();

0 commit comments

Comments
 (0)