Skip to content

Commit

Permalink
DATAMONGO-2385 - Polishing.
Browse files Browse the repository at this point in the history
Remove null checks for arguments known to be not-null. Remove Nullable annotations from methods that never return null.

Original pull request: #802.
  • Loading branch information
mp911de committed Nov 11, 2019
1 parent ff60149 commit 9eaf671
Showing 1 changed file with 2 additions and 4 deletions.
Expand Up @@ -211,7 +211,7 @@ enum URLToStringConverter implements Converter<URL, String> {
INSTANCE;

public String convert(URL source) {
return source == null ? null : source.toString();
return source.toString();
}
}

Expand All @@ -224,7 +224,7 @@ enum StringToURLConverter implements Converter<String, URL> {
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);
}
Expand Down Expand Up @@ -483,7 +483,6 @@ enum BinaryToByteArrayConverter implements Converter<Binary, byte[]> {

INSTANCE;

@Nullable
@Override
public byte[] convert(Binary source) {
return source.getData();
Expand All @@ -501,7 +500,6 @@ enum BsonTimestampToInstantConverter implements Converter<BsonTimestamp, Instant

INSTANCE;

@Nullable
@Override
public Instant convert(BsonTimestamp source) {
return Instant.ofEpochSecond(source.getTime(), 0);
Expand Down

0 comments on commit 9eaf671

Please sign in to comment.