Skip to content

DATAJDBC-355 - Remove unnecessary null check. #146

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import org.springframework.data.jdbc.repository.support.JdbcRepositoryFactory;
import org.springframework.data.jdbc.testing.TestConfiguration;
import org.springframework.data.repository.CrudRepository;
import org.springframework.lang.Nullable;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.rules.SpringClassRule;
import org.springframework.test.context.junit4.rules.SpringMethodRule;
Expand Down Expand Up @@ -93,9 +92,9 @@ JdbcCustomConversions jdbcCustomConversions() {
*
* @Override
* @Nullable
* public BigDecimal convert(@Nullable String source) {
* public BigDecimal convert(String source) {
*
* return source == null ? null : new BigDecimal(source);
* return source == new BigDecimal(source);
* }
* }
* </pre>
Expand Down Expand Up @@ -130,9 +129,9 @@ enum StringToBigDecimalConverter implements Converter<String, JdbcValue> {
INSTANCE;

@Override
public JdbcValue convert(@Nullable String source) {
public JdbcValue convert(String source) {

Object value = source == null ? null : new BigDecimal(source);
Object value = new BigDecimal(source);
return JdbcValue.of(value, JDBCType.DECIMAL);
}

Expand All @@ -144,11 +143,7 @@ enum BigDecimalToString implements Converter<BigDecimal, String> {
INSTANCE;

@Override
public String convert(@Nullable BigDecimal source) {

if (source == null) {
return null;
}
public String convert(BigDecimal source) {

return source.toString();
}
Expand Down