You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/08/04 09:31:53 UTC
[GitHub] [shardingsphere] yx9o opened a new pull request #11641: Modify the conditional expression
yx9o opened a new pull request #11641:
URL: https://github.com/apache/shardingsphere/pull/11641
Adjust the conditional expression according to the ss coding standard.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] terrymanu commented on a change in pull request #11641: Modify the conditional expression
Posted by GitBox <gi...@apache.org>.
terrymanu commented on a change in pull request #11641:
URL: https://github.com/apache/shardingsphere/pull/11641#discussion_r682453005
##########
File path: shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/resultset/ResultSetUtil.java
##########
@@ -115,14 +115,14 @@ public static Object convertBigDecimalValue(final Object value, final boolean ne
}
private static BigDecimal adjustBigDecimalResult(final BigDecimal value, final boolean needScale, final int scale) {
- if (needScale) {
- try {
- return value.setScale(scale);
- } catch (final ArithmeticException ex) {
- return value.setScale(scale, BigDecimal.ROUND_HALF_UP);
- }
- }
- return value;
+ if (!needScale){
+ return value;
+ }
+ try {
+ return value.setScale(scale);
+ } catch (final ArithmeticException ex) {
+ return value.setScale(scale, BigDecimal.ROUND_HALF_UP);
+ }
Review comment:
This is guard clauses, please keep the original codes
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] codecov-commenter commented on pull request #11641: Modify the conditional expression
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #11641:
URL: https://github.com/apache/shardingsphere/pull/11641#issuecomment-892613984
# [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11641?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#11641](https://codecov.io/gh/apache/shardingsphere/pull/11641?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (5c5d71c) into [master](https://codecov.io/gh/apache/shardingsphere/commit/9f9bc59a86fbb14f61bc02e031ca19da21e62236?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (9f9bc59) will **increase** coverage by `0.05%`.
> The diff coverage is `67.10%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/shardingsphere/pull/11641/graphs/tree.svg?width=650&height=150&src=pr&token=ZvlXpWa7so&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/shardingsphere/pull/11641?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #11641 +/- ##
============================================
+ Coverage 63.75% 63.80% +0.05%
- Complexity 1116 1122 +6
============================================
Files 2252 2253 +1
Lines 34333 34381 +48
Branches 5996 6011 +15
============================================
+ Hits 21889 21938 +49
+ Misses 10675 10672 -3
- Partials 1769 1771 +2
```
| [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/11641?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...ics/api/advice/ShardingSphereDataSourceAdvice.java](https://codecov.io/gh/apache/shardingsphere/pull/11641/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtYWdlbnQvc2hhcmRpbmdzcGhlcmUtYWdlbnQtcGx1Z2lucy9zaGFyZGluZ3NwaGVyZS1hZ2VudC1wbHVnaW4tbWV0cmljcy9zaGFyZGluZ3NwaGVyZS1hZ2VudC1tZXRyaWNzLWFwaS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvYWdlbnQvbWV0cmljcy9hcGkvYWR2aWNlL1NoYXJkaW5nU3BoZXJlRGF0YVNvdXJjZUFkdmljZS5qYXZh) | `0.00% <ø> (ø)` | |
| [...ngsphere/agent/metrics/api/constant/MetricIds.java](https://codecov.io/gh/apache/shardingsphere/pull/11641/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtYWdlbnQvc2hhcmRpbmdzcGhlcmUtYWdlbnQtcGx1Z2lucy9zaGFyZGluZ3NwaGVyZS1hZ2VudC1wbHVnaW4tbWV0cmljcy9zaGFyZGluZ3NwaGVyZS1hZ2VudC1tZXRyaWNzLWFwaS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvYWdlbnQvbWV0cmljcy9hcGkvY29uc3RhbnQvTWV0cmljSWRzLmphdmE=) | `0.00% <ø> (ø)` | |
| [...dingsphere/agent/metrics/api/util/MetricsUtil.java](https://codecov.io/gh/apache/shardingsphere/pull/11641/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtYWdlbnQvc2hhcmRpbmdzcGhlcmUtYWdlbnQtcGx1Z2lucy9zaGFyZGluZ3NwaGVyZS1hZ2VudC1wbHVnaW4tbWV0cmljcy9zaGFyZGluZ3NwaGVyZS1hZ2VudC1tZXRyaWNzLWFwaS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvYWdlbnQvbWV0cmljcy9hcGkvdXRpbC9NZXRyaWNzVXRpbC5qYXZh) | `0.00% <0.00%> (ø)` | |
| [...cs/prometheus/collector/MetaDataInfoCollector.java](https://codecov.io/gh/apache/shardingsphere/pull/11641/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtYWdlbnQvc2hhcmRpbmdzcGhlcmUtYWdlbnQtcGx1Z2lucy9zaGFyZGluZ3NwaGVyZS1hZ2VudC1wbHVnaW4tbWV0cmljcy9zaGFyZGluZ3NwaGVyZS1hZ2VudC1tZXRyaWNzLXByb21ldGhldXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2FnZW50L21ldHJpY3MvcHJvbWV0aGV1cy9jb2xsZWN0b3IvTWV0YURhdGFJbmZvQ29sbGVjdG9yLmphdmE=) | `55.17% <0.00%> (ø)` | |
| [...trics/prometheus/collector/ProxyInfoCollector.java](https://codecov.io/gh/apache/shardingsphere/pull/11641/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtYWdlbnQvc2hhcmRpbmdzcGhlcmUtYWdlbnQtcGx1Z2lucy9zaGFyZGluZ3NwaGVyZS1hZ2VudC1wbHVnaW4tbWV0cmljcy9zaGFyZGluZ3NwaGVyZS1hZ2VudC1tZXRyaWNzLXByb21ldGhldXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2FnZW50L21ldHJpY3MvcHJvbWV0aGV1cy9jb2xsZWN0b3IvUHJveHlJbmZvQ29sbGVjdG9yLmphdmE=) | `71.42% <0.00%> (ø)` | |
| [...metrics/prometheus/hikari/HikariSimpleMetrics.java](https://codecov.io/gh/apache/shardingsphere/pull/11641/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtYWdlbnQvc2hhcmRpbmdzcGhlcmUtYWdlbnQtcGx1Z2lucy9zaGFyZGluZ3NwaGVyZS1hZ2VudC1wbHVnaW4tbWV0cmljcy9zaGFyZGluZ3NwaGVyZS1hZ2VudC1tZXRyaWNzLXByb21ldGhldXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2FnZW50L21ldHJpY3MvcHJvbWV0aGV1cy9oaWthcmkvSGlrYXJpU2ltcGxlTWV0cmljcy5qYXZh) | `100.00% <ø> (ø)` | |
| [...core/resultset/GeneratedKeysResultSetMetaData.java](https://codecov.io/gh/apache/shardingsphere/pull/11641/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtamRiYy9zaGFyZGluZ3NwaGVyZS1qZGJjLWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2RyaXZlci9qZGJjL2NvcmUvcmVzdWx0c2V0L0dlbmVyYXRlZEtleXNSZXN1bHRTZXRNZXRhRGF0YS5qYXZh) | `51.21% <0.00%> (ø)` | |
| [...ere/agent/metrics/api/advice/DataSourceAdvice.java](https://codecov.io/gh/apache/shardingsphere/pull/11641/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtYWdlbnQvc2hhcmRpbmdzcGhlcmUtYWdlbnQtcGx1Z2lucy9zaGFyZGluZ3NwaGVyZS1hZ2VudC1wbHVnaW4tbWV0cmljcy9zaGFyZGluZ3NwaGVyZS1hZ2VudC1tZXRyaWNzLWFwaS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvYWdlbnQvbWV0cmljcy9hcGkvYWR2aWNlL0RhdGFTb3VyY2VBZHZpY2UuamF2YQ==) | `100.00% <100.00%> (ø)` | |
| [...gent/metrics/api/advice/SQLParserEngineAdvice.java](https://codecov.io/gh/apache/shardingsphere/pull/11641/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtYWdlbnQvc2hhcmRpbmdzcGhlcmUtYWdlbnQtcGx1Z2lucy9zaGFyZGluZ3NwaGVyZS1hZ2VudC1wbHVnaW4tbWV0cmljcy9zaGFyZGluZ3NwaGVyZS1hZ2VudC1tZXRyaWNzLWFwaS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvYWdlbnQvbWV0cmljcy9hcGkvYWR2aWNlL1NRTFBhcnNlckVuZ2luZUFkdmljZS5qYXZh) | `100.00% <100.00%> (ø)` | |
| [...agent/metrics/api/advice/SQLRouteEngineAdvice.java](https://codecov.io/gh/apache/shardingsphere/pull/11641/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtYWdlbnQvc2hhcmRpbmdzcGhlcmUtYWdlbnQtcGx1Z2lucy9zaGFyZGluZ3NwaGVyZS1hZ2VudC1wbHVnaW4tbWV0cmljcy9zaGFyZGluZ3NwaGVyZS1hZ2VudC1tZXRyaWNzLWFwaS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvYWdlbnQvbWV0cmljcy9hcGkvYWR2aWNlL1NRTFJvdXRlRW5naW5lQWR2aWNlLmphdmE=) | `93.54% <100.00%> (ø)` | |
| ... and [14 more](https://codecov.io/gh/apache/shardingsphere/pull/11641/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11641?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11641?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [3bb1e99...5c5d71c](https://codecov.io/gh/apache/shardingsphere/pull/11641?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] yx9o commented on a change in pull request #11641: Modify the conditional expression
Posted by GitBox <gi...@apache.org>.
yx9o commented on a change in pull request #11641:
URL: https://github.com/apache/shardingsphere/pull/11641#discussion_r682528589
##########
File path: shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/resultset/ResultSetUtil.java
##########
@@ -115,14 +115,14 @@ public static Object convertBigDecimalValue(final Object value, final boolean ne
}
private static BigDecimal adjustBigDecimalResult(final BigDecimal value, final boolean needScale, final int scale) {
- if (needScale) {
- try {
- return value.setScale(scale);
- } catch (final ArithmeticException ex) {
- return value.setScale(scale, BigDecimal.ROUND_HALF_UP);
- }
- }
- return value;
+ if (!needScale){
+ return value;
+ }
+ try {
+ return value.setScale(scale);
+ } catch (final ArithmeticException ex) {
+ return value.setScale(scale, BigDecimal.ROUND_HALF_UP);
+ }
Review comment:
Hi, the code has been rolled back, please review.
But I think the modified statement conforms to the guard clauses, and the code is more concise.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] terrymanu commented on a change in pull request #11641: Modify the conditional expression
Posted by GitBox <gi...@apache.org>.
terrymanu commented on a change in pull request #11641:
URL: https://github.com/apache/shardingsphere/pull/11641#discussion_r682611525
##########
File path: shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/resultset/ResultSetUtil.java
##########
@@ -115,14 +115,14 @@ public static Object convertBigDecimalValue(final Object value, final boolean ne
}
private static BigDecimal adjustBigDecimalResult(final BigDecimal value, final boolean needScale, final int scale) {
- if (needScale) {
- try {
- return value.setScale(scale);
- } catch (final ArithmeticException ex) {
- return value.setScale(scale, BigDecimal.ROUND_HALF_UP);
- }
- }
- return value;
+ if (!needScale){
+ return value;
+ }
+ try {
+ return value.setScale(scale);
+ } catch (final ArithmeticException ex) {
+ return value.setScale(scale, BigDecimal.ROUND_HALF_UP);
+ }
Review comment:
Thank you
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] terrymanu merged pull request #11641: Modify the conditional expression
Posted by GitBox <gi...@apache.org>.
terrymanu merged pull request #11641:
URL: https://github.com/apache/shardingsphere/pull/11641
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] codecov-commenter commented on pull request #11641: Modify the conditional expression
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #11641:
URL: https://github.com/apache/shardingsphere/pull/11641#issuecomment-892613984
# [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11641?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#11641](https://codecov.io/gh/apache/shardingsphere/pull/11641?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (5c5d71c) into [master](https://codecov.io/gh/apache/shardingsphere/commit/9f9bc59a86fbb14f61bc02e031ca19da21e62236?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (9f9bc59) will **increase** coverage by `0.05%`.
> The diff coverage is `67.10%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/shardingsphere/pull/11641/graphs/tree.svg?width=650&height=150&src=pr&token=ZvlXpWa7so&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/shardingsphere/pull/11641?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #11641 +/- ##
============================================
+ Coverage 63.75% 63.80% +0.05%
- Complexity 1116 1122 +6
============================================
Files 2252 2253 +1
Lines 34333 34381 +48
Branches 5996 6011 +15
============================================
+ Hits 21889 21938 +49
+ Misses 10675 10672 -3
- Partials 1769 1771 +2
```
| [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/11641?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...ics/api/advice/ShardingSphereDataSourceAdvice.java](https://codecov.io/gh/apache/shardingsphere/pull/11641/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtYWdlbnQvc2hhcmRpbmdzcGhlcmUtYWdlbnQtcGx1Z2lucy9zaGFyZGluZ3NwaGVyZS1hZ2VudC1wbHVnaW4tbWV0cmljcy9zaGFyZGluZ3NwaGVyZS1hZ2VudC1tZXRyaWNzLWFwaS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvYWdlbnQvbWV0cmljcy9hcGkvYWR2aWNlL1NoYXJkaW5nU3BoZXJlRGF0YVNvdXJjZUFkdmljZS5qYXZh) | `0.00% <ø> (ø)` | |
| [...ngsphere/agent/metrics/api/constant/MetricIds.java](https://codecov.io/gh/apache/shardingsphere/pull/11641/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtYWdlbnQvc2hhcmRpbmdzcGhlcmUtYWdlbnQtcGx1Z2lucy9zaGFyZGluZ3NwaGVyZS1hZ2VudC1wbHVnaW4tbWV0cmljcy9zaGFyZGluZ3NwaGVyZS1hZ2VudC1tZXRyaWNzLWFwaS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvYWdlbnQvbWV0cmljcy9hcGkvY29uc3RhbnQvTWV0cmljSWRzLmphdmE=) | `0.00% <ø> (ø)` | |
| [...dingsphere/agent/metrics/api/util/MetricsUtil.java](https://codecov.io/gh/apache/shardingsphere/pull/11641/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtYWdlbnQvc2hhcmRpbmdzcGhlcmUtYWdlbnQtcGx1Z2lucy9zaGFyZGluZ3NwaGVyZS1hZ2VudC1wbHVnaW4tbWV0cmljcy9zaGFyZGluZ3NwaGVyZS1hZ2VudC1tZXRyaWNzLWFwaS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvYWdlbnQvbWV0cmljcy9hcGkvdXRpbC9NZXRyaWNzVXRpbC5qYXZh) | `0.00% <0.00%> (ø)` | |
| [...cs/prometheus/collector/MetaDataInfoCollector.java](https://codecov.io/gh/apache/shardingsphere/pull/11641/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtYWdlbnQvc2hhcmRpbmdzcGhlcmUtYWdlbnQtcGx1Z2lucy9zaGFyZGluZ3NwaGVyZS1hZ2VudC1wbHVnaW4tbWV0cmljcy9zaGFyZGluZ3NwaGVyZS1hZ2VudC1tZXRyaWNzLXByb21ldGhldXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2FnZW50L21ldHJpY3MvcHJvbWV0aGV1cy9jb2xsZWN0b3IvTWV0YURhdGFJbmZvQ29sbGVjdG9yLmphdmE=) | `55.17% <0.00%> (ø)` | |
| [...trics/prometheus/collector/ProxyInfoCollector.java](https://codecov.io/gh/apache/shardingsphere/pull/11641/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtYWdlbnQvc2hhcmRpbmdzcGhlcmUtYWdlbnQtcGx1Z2lucy9zaGFyZGluZ3NwaGVyZS1hZ2VudC1wbHVnaW4tbWV0cmljcy9zaGFyZGluZ3NwaGVyZS1hZ2VudC1tZXRyaWNzLXByb21ldGhldXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2FnZW50L21ldHJpY3MvcHJvbWV0aGV1cy9jb2xsZWN0b3IvUHJveHlJbmZvQ29sbGVjdG9yLmphdmE=) | `71.42% <0.00%> (ø)` | |
| [...metrics/prometheus/hikari/HikariSimpleMetrics.java](https://codecov.io/gh/apache/shardingsphere/pull/11641/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtYWdlbnQvc2hhcmRpbmdzcGhlcmUtYWdlbnQtcGx1Z2lucy9zaGFyZGluZ3NwaGVyZS1hZ2VudC1wbHVnaW4tbWV0cmljcy9zaGFyZGluZ3NwaGVyZS1hZ2VudC1tZXRyaWNzLXByb21ldGhldXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2FnZW50L21ldHJpY3MvcHJvbWV0aGV1cy9oaWthcmkvSGlrYXJpU2ltcGxlTWV0cmljcy5qYXZh) | `100.00% <ø> (ø)` | |
| [...core/resultset/GeneratedKeysResultSetMetaData.java](https://codecov.io/gh/apache/shardingsphere/pull/11641/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtamRiYy9zaGFyZGluZ3NwaGVyZS1qZGJjLWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2RyaXZlci9qZGJjL2NvcmUvcmVzdWx0c2V0L0dlbmVyYXRlZEtleXNSZXN1bHRTZXRNZXRhRGF0YS5qYXZh) | `51.21% <0.00%> (ø)` | |
| [...ere/agent/metrics/api/advice/DataSourceAdvice.java](https://codecov.io/gh/apache/shardingsphere/pull/11641/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtYWdlbnQvc2hhcmRpbmdzcGhlcmUtYWdlbnQtcGx1Z2lucy9zaGFyZGluZ3NwaGVyZS1hZ2VudC1wbHVnaW4tbWV0cmljcy9zaGFyZGluZ3NwaGVyZS1hZ2VudC1tZXRyaWNzLWFwaS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvYWdlbnQvbWV0cmljcy9hcGkvYWR2aWNlL0RhdGFTb3VyY2VBZHZpY2UuamF2YQ==) | `100.00% <100.00%> (ø)` | |
| [...gent/metrics/api/advice/SQLParserEngineAdvice.java](https://codecov.io/gh/apache/shardingsphere/pull/11641/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtYWdlbnQvc2hhcmRpbmdzcGhlcmUtYWdlbnQtcGx1Z2lucy9zaGFyZGluZ3NwaGVyZS1hZ2VudC1wbHVnaW4tbWV0cmljcy9zaGFyZGluZ3NwaGVyZS1hZ2VudC1tZXRyaWNzLWFwaS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvYWdlbnQvbWV0cmljcy9hcGkvYWR2aWNlL1NRTFBhcnNlckVuZ2luZUFkdmljZS5qYXZh) | `100.00% <100.00%> (ø)` | |
| [...agent/metrics/api/advice/SQLRouteEngineAdvice.java](https://codecov.io/gh/apache/shardingsphere/pull/11641/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtYWdlbnQvc2hhcmRpbmdzcGhlcmUtYWdlbnQtcGx1Z2lucy9zaGFyZGluZ3NwaGVyZS1hZ2VudC1wbHVnaW4tbWV0cmljcy9zaGFyZGluZ3NwaGVyZS1hZ2VudC1tZXRyaWNzLWFwaS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvYWdlbnQvbWV0cmljcy9hcGkvYWR2aWNlL1NRTFJvdXRlRW5naW5lQWR2aWNlLmphdmE=) | `93.54% <100.00%> (ø)` | |
| ... and [14 more](https://codecov.io/gh/apache/shardingsphere/pull/11641/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11641?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11641?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [3bb1e99...5c5d71c](https://codecov.io/gh/apache/shardingsphere/pull/11641?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] yx9o commented on a change in pull request #11641: Modify the conditional expression
Posted by GitBox <gi...@apache.org>.
yx9o commented on a change in pull request #11641:
URL: https://github.com/apache/shardingsphere/pull/11641#discussion_r682528589
##########
File path: shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/resultset/ResultSetUtil.java
##########
@@ -115,14 +115,14 @@ public static Object convertBigDecimalValue(final Object value, final boolean ne
}
private static BigDecimal adjustBigDecimalResult(final BigDecimal value, final boolean needScale, final int scale) {
- if (needScale) {
- try {
- return value.setScale(scale);
- } catch (final ArithmeticException ex) {
- return value.setScale(scale, BigDecimal.ROUND_HALF_UP);
- }
- }
- return value;
+ if (!needScale){
+ return value;
+ }
+ try {
+ return value.setScale(scale);
+ } catch (final ArithmeticException ex) {
+ return value.setScale(scale, BigDecimal.ROUND_HALF_UP);
+ }
Review comment:
Hi, the code has been rolled back, please review.
But I think the modified statement conforms to the guard clauses, and the code is more concise.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] terrymanu merged pull request #11641: Modify the conditional expression
Posted by GitBox <gi...@apache.org>.
terrymanu merged pull request #11641:
URL: https://github.com/apache/shardingsphere/pull/11641
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] terrymanu commented on a change in pull request #11641: Modify the conditional expression
Posted by GitBox <gi...@apache.org>.
terrymanu commented on a change in pull request #11641:
URL: https://github.com/apache/shardingsphere/pull/11641#discussion_r682611525
##########
File path: shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/resultset/ResultSetUtil.java
##########
@@ -115,14 +115,14 @@ public static Object convertBigDecimalValue(final Object value, final boolean ne
}
private static BigDecimal adjustBigDecimalResult(final BigDecimal value, final boolean needScale, final int scale) {
- if (needScale) {
- try {
- return value.setScale(scale);
- } catch (final ArithmeticException ex) {
- return value.setScale(scale, BigDecimal.ROUND_HALF_UP);
- }
- }
- return value;
+ if (!needScale){
+ return value;
+ }
+ try {
+ return value.setScale(scale);
+ } catch (final ArithmeticException ex) {
+ return value.setScale(scale, BigDecimal.ROUND_HALF_UP);
+ }
Review comment:
Thank you
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org