39
39
import org .springframework .data .jdbc .repository .support .JdbcRepositoryFactory ;
40
40
import org .springframework .data .jdbc .testing .TestConfiguration ;
41
41
import org .springframework .data .repository .CrudRepository ;
42
- import org .springframework .lang .Nullable ;
43
42
import org .springframework .test .context .ContextConfiguration ;
44
43
import org .springframework .test .context .junit4 .rules .SpringClassRule ;
45
44
import org .springframework .test .context .junit4 .rules .SpringMethodRule ;
49
48
* Tests storing and retrieving data types that get processed by custom conversions.
50
49
*
51
50
* @author Jens Schauder
51
+ * @author Sanghyuk Jung
52
52
*/
53
53
@ ContextConfiguration
54
54
@ Transactional
@@ -93,9 +93,9 @@ JdbcCustomConversions jdbcCustomConversions() {
93
93
*
94
94
* @Override
95
95
* @Nullable
96
- * public BigDecimal convert(@Nullable String source) {
96
+ * public BigDecimal convert(String source) {
97
97
*
98
- * return source == null ? null : new BigDecimal(source);
98
+ * return source == new BigDecimal(source);
99
99
* }
100
100
* }
101
101
* </pre>
@@ -130,9 +130,9 @@ enum StringToBigDecimalConverter implements Converter<String, JdbcValue> {
130
130
INSTANCE ;
131
131
132
132
@ Override
133
- public JdbcValue convert (@ Nullable String source ) {
133
+ public JdbcValue convert (String source ) {
134
134
135
- Object value = source == null ? null : new BigDecimal (source );
135
+ Object value = new BigDecimal (source );
136
136
return JdbcValue .of (value , JDBCType .DECIMAL );
137
137
}
138
138
@@ -144,11 +144,7 @@ enum BigDecimalToString implements Converter<BigDecimal, String> {
144
144
INSTANCE ;
145
145
146
146
@ Override
147
- public String convert (@ Nullable BigDecimal source ) {
148
-
149
- if (source == null ) {
150
- return null ;
151
- }
147
+ public String convert (BigDecimal source ) {
152
148
153
149
return source .toString ();
154
150
}
0 commit comments