Skip to content

Duplicate code in StringToPropertiesConverter class #3020

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wendy512 opened this issue Oct 12, 2024 · 1 comment · May be fixed by #3022
Open

Duplicate code in StringToPropertiesConverter class #3020

wendy512 opened this issue Oct 12, 2024 · 1 comment · May be fixed by #3022
Labels
status: ideal-for-contribution An issue that a contributor can help us with type: task A general task

Comments

@wendy512
Copy link

public class StringToPropertiesConverter implements Converter<String, Properties> {

	@Override
	public Properties convert(String source) {

		Properties info = new Properties();
		try (StringReader stringReader = new StringReader(source)) {
			info.load(stringReader);
		} catch (Exception ex) {
			throw new RedisSystemException("Cannot read Redis info", ex);
		}
		return info;
	}
}

Converting String type content into Properties has been defined in org.springframework.data.redis.connection.convert.Converters.
Can I try to optimize and submit a PR?

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Oct 12, 2024
@mp911de
Copy link
Member

mp911de commented Oct 14, 2024

Feel free. We should actually deprecate StringToPropertiesConverter and use only the one from Converters.toProperties(…).

@mp911de mp911de added type: task A general task status: ideal-for-contribution An issue that a contributor can help us with and removed status: waiting-for-triage An issue we've not yet triaged labels Oct 14, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
status: ideal-for-contribution An issue that a contributor can help us with type: task A general task
Projects
None yet
3 participants