-
Notifications
You must be signed in to change notification settings - Fork 26.4k
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 ConfigUtils.java #2562
Update ConfigUtils.java #2562
Conversation
add scene judgement in windows environment Fix 2557
@@ -217,7 +217,8 @@ public static Properties loadProperties(String fileName, boolean allowMultiFile) | |||
*/ | |||
public static Properties loadProperties(String fileName, boolean allowMultiFile, boolean optional) { | |||
Properties properties = new Properties(); | |||
if (fileName.startsWith("/")) { | |||
//add scene judgement in windows environment Fix 2557 | |||
if (fileName.startsWith("/")||fileName.matches("^[A-z]:\\\\\\S+$")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
Would u pls format your code?
-
Pls use doc as this:
// add scene...
Remember the space. -
pls add some unit test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1.sorry,I do not format my code,I will do it.
2.ok.I will get the space.
3. the testcase(com.alibaba.dubbo.config.AbstractInterfaceConfigTest#checkApplication1) existed before
Codecov Report
@@ Coverage Diff @@
## master #2562 +/- ##
============================================
- Coverage 54.96% 54.93% -0.04%
+ Complexity 5278 5275 -3
============================================
Files 573 573
Lines 25517 25517
Branches 4531 4531
============================================
- Hits 14026 14018 -8
- Misses 9390 9392 +2
- Partials 2101 2107 +6
Continue to review full report at Codecov.
|
formate the code add the space
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have do all as you list.@carryxyh
@@ -217,7 +217,8 @@ public static Properties loadProperties(String fileName, boolean allowMultiFile) | |||
*/ | |||
public static Properties loadProperties(String fileName, boolean allowMultiFile, boolean optional) { | |||
Properties properties = new Properties(); | |||
if (fileName.startsWith("/")) { | |||
//add scene judgement in windows environment Fix 2557 | |||
if (fileName.startsWith("/")||fileName.matches("^[A-z]:\\\\\\S+$")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1.sorry,I do not format my code,I will do it.
2.ok.I will get the space.
3. the testcase(com.alibaba.dubbo.config.AbstractInterfaceConfigTest#checkApplication1) existed before
@SuperDubbo |
add scene judgement in windows environment Fix 2557
What is the purpose of the change
fix #2557
Brief changelog
add scene judgement in windows environment
Verifying this change
When run the testcase(com.alibaba.dubbo.config.AbstractInterfaceConfigTest#checkApplication1) in windows environment,It will be wrong.
So It should add scene judgement in windows environment(org.apache.dubbo.common.utils.ConfigUtils#loadProperties(java.lang.String, boolean, boolean),Line 220).
if (fileName.startsWith("/")) {
change to
if (fileName.startsWith("/")||fileName.matches("^[A-z]:\\\S+$")) {
the testcase (com.alibaba.dubbo.config.AbstractInterfaceConfigTest#checkApplication1) will go well.
Follow this checklist to help us incorporate your contribution quickly and easily:
[Dubbo-XXX] Fix UnknownException when host config not exist #XXX
. Each commit in the pull request should have a meaningful subject line and body.mvn clean install -DskipTests
&mvn clean test-compile failsafe:integration-test
to make sure unit-test and integration-test pass.