Skip to content

Commit

Permalink
Fix resolving environmentConfigurationPropertyName.
Browse files Browse the repository at this point in the history
  • Loading branch information
OlgaMaciaszek committed Apr 26, 2024
1 parent d5fc03d commit c971c30
Showing 1 changed file with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,16 +169,11 @@ private void generateRegisterPropertyBeanDefinitionsMethod(MethodSpec.Builder me
if (matcher.find()) {
String indexString = matcher.group(3);
int index = Integer.parseInt(indexString);
// method.addStatement(
// "$T[] factoryTypes =
// $T.getEnvironmentRepositoryFactoryTypeParams(beanFactory, $S)",
// Type.class, CompositeUtils.class, factoryName);
// method.addStatement("""
// Class<? extends EnvironmentRepositoryProperties> propertiesClass
// = (Class<? extends EnvironmentRepositoryProperties>)
// factoryTypes[1]""");
String environmentConfigurationPropertyName = String
.format("spring.cloud.config.server.composite[%d]", index);
method.addStatement("$T properties$L = binder.bindOrCreate($S, $T.class)",
EnvironmentRepositoryProperties.class, index, beanName, propertiesClass);
EnvironmentRepositoryProperties.class, index, environmentConfigurationPropertyName,
propertiesClass);
method.addStatement("properties$L.setOrder($L)", index, index + 1);
method.addStatement(
"$T propertiesDefinition$L = "
Expand Down

0 comments on commit c971c30

Please sign in to comment.