Fix ambiguous autowiring

Report a typo

Here a bean cannot be autowired because there are two suitable beans.

Java
@Bean
public Long maxNumber() {
    return 100_000_000_000L;
}
    
@Bean
public Long minNumber() {
    return 0L;
}
    
@Bean
public Long anotherNumber(/* FIX ME */ Long number) {
    return number + 100;
}
Kotlin
@Bean
fun maxNumber(): Long {
    return 100_000_000_000L
}

@Bean
fun minNumber(): Long {
    return 0L
}

@Bean
fun anotherNumber( /* FIX ME */ number: Long): Long {
    return number + 100
}

Enter what you should write instead of /* FIX ME */ to autowire the minNumber bean.

Enter a short text
___

Create a free account to access the full topic