Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Update PropertiesFactory.java #3362

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@ public boolean isSet(Class clazz, String name) {
public String getClassName(Class clazz, String name) {
if (this.classToProperty.containsKey(clazz)) {
String classNameProperty = this.classToProperty.get(clazz);
String className = environment
.getProperty(name + "." + NAMESPACE + "." + classNameProperty);
String className = environment.getProperty(name + "." + NAMESPACE + "." + classNameProperty);
if(!StringUtils.hasText(className)){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we return null in the case where it is the empty string?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when empty, it should return environment.getProperty(NAMESPACE + "." + classNameProperty);
this is for setting default properties:
in https://github.com/Netflix/ribbon/wiki/Programmers-Guide , descript:
If a property is missing the clientName, it is interpreted as a property that applies to all clients.

className = environment.getProperty(NAMESPACE + "." + classNameProperty);
}
return className;
}
return null;
Expand Down