|
|
|
|
@ -1,5 +1,5 @@
@@ -1,5 +1,5 @@
|
|
|
|
|
/* |
|
|
|
|
* Copyright 2002-2022 the original author or authors. |
|
|
|
|
* Copyright 2002-2023 the original author or authors. |
|
|
|
|
* |
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
|
@ -55,6 +55,7 @@ import org.springframework.util.ObjectUtils;
@@ -55,6 +55,7 @@ import org.springframework.util.ObjectUtils;
|
|
|
|
|
* |
|
|
|
|
* @author Stephane Nicoll |
|
|
|
|
* @author Phillip Webb |
|
|
|
|
* @author Sebastien Deleuze |
|
|
|
|
* @since 6.0 |
|
|
|
|
*/ |
|
|
|
|
class BeanDefinitionPropertyValueCodeGenerator { |
|
|
|
|
@ -448,7 +449,12 @@ class BeanDefinitionPropertyValueCodeGenerator {
@@ -448,7 +449,12 @@ class BeanDefinitionPropertyValueCodeGenerator {
|
|
|
|
|
return CodeBlock.of("new $T($L)", LinkedHashSet.class, |
|
|
|
|
generateCollectionOf(set, List.class, elementType)); |
|
|
|
|
} |
|
|
|
|
set = orderForCodeConsistency(set); |
|
|
|
|
try { |
|
|
|
|
set = orderForCodeConsistency(set); |
|
|
|
|
} |
|
|
|
|
catch (ClassCastException ex) { |
|
|
|
|
// If elements are not comparable, just keep the original set
|
|
|
|
|
} |
|
|
|
|
return super.generateCollectionCode(elementType, set); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|