Skip to content

Conversation

@benelog
Copy link
Contributor

@benelog benelog commented Mar 28, 2019

The following logic to check null value seems unnecessary.

	@ReadingConverter
	enum BigDecimalToString implements Converter<BigDecimal, String> {

		INSTANCE;

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

			if (source == null) {
				return null;
			}

			return source.toString();
		}
	}

The source parameter must not be null according to Javadoc of Converter.

https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/core/convert/converter/Converter.html

@schauder schauder changed the title Remove unnecessary null check DATAJDBC-355 - Remove unnecessary null check. Apr 8, 2019
schauder pushed a commit that referenced this pull request Apr 8, 2019
The source parameter must not be null according to Javadoc of Converter.

See also: https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/core/convert/converter/Converter.html

Original pull request: #146.
@schauder
Copy link
Contributor

schauder commented Apr 8, 2019

That's merged.
Thanks.

@schauder schauder closed this Apr 8, 2019
@benelog benelog deleted the remove-null-check branch October 27, 2021 07:03
mp911de added a commit that referenced this pull request Feb 21, 2022
mp911de added a commit that referenced this pull request Feb 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants