spring-framework icon indicating copy to clipboard operation
spring-framework copied to clipboard

Prepend existing prefix to new feature name prefix in GenerationContext.withName()

Open sbrannen opened this issue 3 years ago • 0 comments

As discussed in https://github.com/spring-projects/spring-framework/issues/28928#issuecomment-1209411867, we should change the semantics of GenerationContext.withName(String) so that an existing "feature name prefix" is not lost.

Specifically, we should prepend any existing prefix to a new provided prefix to ensure that there are no clashes with generated names.

This change may also be helpful in implementing #28204.

As mentioned by @snicoll, "the counter in DefaultGenerationContext [may no longer] need to be transmitted from one context to another."

sbrannen avatar Aug 17 '22 11:08 sbrannen