Skip to content

spring.datasource.dbcp2.username and spring.datasource.dbcp2.password are incorrectly marked as deprecated #40076

Closed
@wilkinsona

Description

@wilkinsona

We bind spring.datasource.dbcp2 to third-party code, namely org.apache.commons.dbcp2.BasicDataSource. getUsername and getPassword on BasicDataSource have been marked as deprecated but setUsername and setPassword have not. For configuration property binding purposes this means that they are not deprecated – the binder only need to call the setters – but the generated metadata states that they are deprecated.

I think there's a general problem here and this is a specific symptom of that problem. The problem is that a getter being deprecated is sufficient for a configuration property to be flagged as deprecated. For a scalar property, I think we should consider requiring the setter to be deprecated before flagging the property as deprecated. For maps, lists, and nested properties, a deprecated getter is probably sufficient signal as the binder needs to use the getter to retrieve any existing value.

Flagging for discussion in a team meeting to decide if and where we should fix this. Given that it's a more general problem, we may want to apply a fix in 3.1.x.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions