Change protocol strings to enum values in parsing Protocol options#12135
Change protocol strings to enum values in parsing Protocol options#12135Attyuttam wants to merge 2 commits intoapache:mainfrom
Conversation
|
Congratulations on your first Pull Request and welcome to the Apache CloudStack community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md)
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #12135 +/- ##
============================================
- Coverage 17.56% 17.55% -0.01%
+ Complexity 15538 15537 -1
============================================
Files 5912 5912
Lines 529383 529383
Branches 64660 64660
============================================
- Hits 92984 92956 -28
- Misses 425941 425968 +27
- Partials 10458 10459 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
DaanHoogland
left a comment
There was a problem hiding this comment.
some alternative (just for consideration)
| private Protocol parseOptions(String[] args) { | ||
| String protocolName = (args.length > 0) ? args[0] : ""; | ||
| Protocol protocol = Protocol.NONE; | ||
| Protocol protocol; |
There was a problem hiding this comment.
| Protocol protocol; | |
| Protocol protocol; | |
| try { | |
| protocol = Protocol.valueOf(protocolName); | |
| } catch (IllegalArgumentException e) { | |
| protocol = Protocol.NONE; | |
| } |
There was a problem hiding this comment.
can use this instead
Protocol protocol = EnumUtils.getEnumIgnoreCase(Protocol.class, protocolName, Protocol.NONE);
btw: no issues with the class, it is not used ...
services/console-proxy/rdpconsole/src/main/java/common/Client.java
Outdated
Show resolved
Hide resolved
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
Description
This PR...
Fixes: #11821
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?