DATAMONGO-2385 - Polishing.

Remove null checks for arguments known to be not-null. Remove Nullable annotations from methods that never return null.

Original pull request: #802.
This commit is contained in:
Mark Paluch
2019-11-11 14:17:01 +01:00
parent ff60149166
commit 9eaf67148d

View File

@@ -211,7 +211,7 @@ abstract class MongoConverters {
INSTANCE;
public String convert(URL source) {
return source == null ? null : source.toString();
return source.toString();
}
}
@@ -224,7 +224,7 @@ abstract class MongoConverters {
public URL convert(String source) {
try {
return source == null ? null : new URL(source);
return new URL(source);
} catch (MalformedURLException e) {
throw new ConversionFailedException(SOURCE, TARGET, source, e);
}
@@ -483,7 +483,6 @@ abstract class MongoConverters {
INSTANCE;
@Nullable
@Override
public byte[] convert(Binary source) {
return source.getData();
@@ -501,7 +500,6 @@ abstract class MongoConverters {
INSTANCE;
@Nullable
@Override
public Instant convert(BsonTimestamp source) {
return Instant.ofEpochSecond(source.getTime(), 0);