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

Conversation

crazyman2010
Copy link

get class name for default

get class name for default
@pivotal-issuemaster
Copy link

@crazyman2010 Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@pivotal-issuemaster
Copy link

@crazyman2010 Thank you for signing the Contributor License Agreement!

@codecov-io
Copy link

Codecov Report

Merging #3362 into master will increase coverage by 0.47%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #3362      +/-   ##
============================================
+ Coverage     65.75%   66.23%   +0.47%     
- Complexity     1515     1517       +2     
============================================
  Files           189      189              
  Lines          7043     7045       +2     
  Branches        857      858       +1     
============================================
+ Hits           4631     4666      +35     
+ Misses         2091     2059      -32     
+ Partials        321      320       -1
Impacted Files Coverage Δ Complexity Δ
...mework/cloud/netflix/ribbon/PropertiesFactory.java 73.91% <100%> (+2.48%) 5 <0> (+1) ⬆️
...netflix/ribbon/ZonePreferenceServerListFilter.java 61.53% <0%> (-11.54%) 9% <0%> (-1%)
...cloud/netflix/turbine/SpringAggregatorFactory.java 60.46% <0%> (+2.32%) 5% <0%> (ø) ⬇️
...etflix/turbine/stream/HystrixStreamAggregator.java 78.94% <0%> (+5.26%) 9% <0%> (+1%) ⬆️
...cloud/netflix/eureka/EurekaInstanceConfigBean.java 69.03% <0%> (+16.75%) 54% <0%> (+1%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 20e04bf...2fc4191. Read the comment docs.

@codecov-io
Copy link

codecov-io commented Jan 24, 2019

Codecov Report

Merging #3362 into master will increase coverage by 0.78%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #3362      +/-   ##
============================================
+ Coverage     65.44%   66.23%   +0.78%     
  Complexity     1517     1517              
============================================
  Files           189      189              
  Lines          7246     7045     -201     
  Branches        863      858       -5     
============================================
- Hits           4742     4666      -76     
+ Misses         2188     2059     -129     
- Partials        316      320       +4
Impacted Files Coverage Δ Complexity Δ
...mework/cloud/netflix/ribbon/PropertiesFactory.java 73.91% <100%> (+1.18%) 5 <0> (+1) ⬆️
...apache/RetryableRibbonLoadBalancingHttpClient.java 81.66% <0%> (-2.85%) 12% <0%> (ø)
...s/route/apache/HttpClientRibbonCommandFactory.java 83.33% <0%> (-2.39%) 2% <0%> (ø)
...rk/cloud/netflix/sidecar/SidecarConfiguration.java 78% <0%> (-2%) 7% <0%> (ø)
...fig/EurekaClientConfigServerAutoConfiguration.java 85.71% <0%> (-1.79%) 5% <0%> (ø)
.../netflix/ribbon/RibbonLoadBalancedRetryPolicy.java 86.27% <0%> (-1.66%) 22% <0%> (ø)
...etflix/ribbon/apache/RibbonApacheHttpResponse.java 30.95% <0%> (-1.61%) 8% <0%> (ø)
...oud/netflix/zuul/filters/post/SendErrorFilter.java 76.36% <0%> (-1.61%) 17% <0%> (ø)
...rk/cloud/netflix/turbine/SpringClusterMonitor.java 46.15% <0%> (-1.35%) 2% <0%> (ø)
...cloud/netflix/turbine/EurekaInstanceDiscovery.java 36.95% <0%> (-1.35%) 5% <0%> (ø)
... and 166 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c8e9ad9...7f2090a. Read the comment docs.

Copy link
Contributor

@ryanjbaxter ryanjbaxter left a comment

Choose a reason for hiding this comment

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

can you describe how this problem comes about?

@@ -39,6 +39,9 @@ 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);
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.

Copy link
Member

@spencergibb spencergibb left a comment

Choose a reason for hiding this comment

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

LGTM, can you add a test?

@crazyman2010
Copy link
Author

add a Codecov Report ?
I don't know how to do it .

@spencergibb
Copy link
Member

Not a report. A unit test that shows this working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants