Skip to content

Commit 20e4680

Browse files
committed
Polishing.
See #1460 Original pull request #1521
1 parent 0694321 commit 20e4680

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

spring-data-jdbc/src/test/java/org/springframework/data/jdbc/core/JdbcAggregateTemplateIntegrationTests.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
* @author Milan Milanov
8888
* @author Mikhail Polivakha
8989
* @author Chirag Tailor
90+
* @author Vincent Galloy
9091
*/
9192
@ContextConfiguration
9293
@Transactional
@@ -1046,11 +1047,13 @@ void insertOnlyPropertyDoesNotGetUpdated() {
10461047
}
10471048

10481049
@Test // GH-1460
1050+
@EnabledOnFeature(SUPPORTS_ARRAYS)
10491051
void readEnumArray() {
1052+
10501053
EnumArrayOwner entity = new EnumArrayOwner();
10511054
entity.digits = new Color[]{Color.BLUE};
10521055

1053-
assertThat(template.save(entity)).isNotNull();
1056+
template.save(entity);
10541057

10551058
assertThat(template.findById(entity.id, EnumArrayOwner.class).digits).isEqualTo(new Color[]{Color.BLUE});
10561059
}

spring-data-relational/src/main/java/org/springframework/data/relational/core/conversion/BasicRelationalConverter.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
* @author Mark Paluch
5555
* @author Jens Schauder
5656
* @author Chirag Tailor
57+
* @author Vincent Galloy
5758
* @see MappingContext
5859
* @see SimpleTypeHolder
5960
* @see CustomConversions
@@ -175,7 +176,11 @@ public Object writeValue(@Nullable Object value, TypeInformation<?> type) {
175176

176177
// TODO: We should add conversion support for arrays, however,
177178
// these should consider multi-dimensional arrays as well.
178-
if (value.getClass().isArray() && !value.getClass().getComponentType().isEnum() && (TypeInformation.OBJECT.equals(type) || type.isCollectionLike())) {
179+
if (value.getClass().isArray() //
180+
&& !value.getClass().getComponentType().isEnum() //
181+
&& (TypeInformation.OBJECT.equals(type) //
182+
|| type.isCollectionLike()) //
183+
) {
179184
return value;
180185
}
181186

0 commit comments

Comments
 (0)