You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@streampark.apache.org by GitBox <gi...@apache.org> on 2022/09/23 16:24:19 UTC
[GitHub] [incubator-streampark] GOODBOY008 opened a new pull request, #1674: [polish] polish code.
GOODBOY008 opened a new pull request, #1674:
URL: https://github.com/apache/incubator-streampark/pull/1674
polish code.
--
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: issues-unsubscribe@streampark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-streampark] wolfboys merged pull request #1674: [polish] polish code.
Posted by GitBox <gi...@apache.org>.
wolfboys merged PR #1674:
URL: https://github.com/apache/incubator-streampark/pull/1674
--
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: issues-unsubscribe@streampark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-streampark] wolfboys commented on a diff in pull request #1674: [polish] polish code.
Posted by GitBox <gi...@apache.org>.
wolfboys commented on code in PR #1674:
URL: https://github.com/apache/incubator-streampark/pull/1674#discussion_r979136084
##########
streampark-plugin/streampark-jvm-profiler/src/main/java/org/apache/streampark/plugin/profiling/util/ClassAndMethodMetricKey.java:
##########
@@ -51,13 +53,13 @@ public boolean equals(Object o) {
ClassAndMethodMetricKey that = (ClassAndMethodMetricKey) o;
- if (className != null ? !className.equals(that.className) : that.className != null) {
+ if (!Objects.equals(className, that.className)) {
return false;
}
- if (methodName != null ? !methodName.equals(that.methodName) : that.methodName != null) {
+ if (!Objects.equals(methodName, that.methodName)) {
return false;
}
- return metricName != null ? metricName.equals(that.metricName) : that.metricName == null;
+ return Objects.equals(metricName, that.metricName);
Review Comment:
` return Objects.equals(className, that.className) && Objects.equals(methodName, that.methodName) && Objects.equals(metricName, that.metricName);`
##########
streampark-plugin/streampark-jvm-profiler/src/main/java/org/apache/streampark/plugin/profiling/util/ClassAndMethod.java:
##########
@@ -53,10 +55,10 @@ public boolean equals(Object o) {
ClassAndMethod that = (ClassAndMethod) o;
- if (className != null ? !className.equals(that.className) : that.className != null) {
+ if (!Objects.equals(className, that.className)) {
return false;
}
- return methodName != null ? methodName.equals(that.methodName) : that.methodName == null;
+ return Objects.equals(methodName, that.methodName);
Review Comment:
emmm, You know:
`return Objects.equals(className, that.className) && Objects.equals(methodName, that.methodName);`
##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/impl/AccessTokenServiceImpl.java:
##########
@@ -99,10 +99,7 @@ public IPage<AccessToken> findAccessTokens(AccessToken tokenParam, RestRequest r
@Override
public boolean checkTokenEffective(Long userId, String token) {
AccessToken res = baseMapper.getByUserToken(userId, token);
- if (Objects.isNull(res) || AccessToken.STATUS_DISABLE.equals(res.getFinalStatus())) {
- return false;
- }
- return true;
+ return !Objects.isNull(res) && !AccessToken.STATUS_DISABLE.equals(res.getFinalStatus());
Review Comment:
this code , We can write it better :
`return res != null && AccessToken.STATUS_ENABLE.equals(res.getFinalStatus());`
##########
streampark-plugin/streampark-jvm-profiler/src/main/java/org/apache/streampark/plugin/profiling/util/ClassMethodArgument.java:
##########
@@ -67,10 +69,10 @@ public boolean equals(Object o) {
if (argumentIndex != that.argumentIndex) {
return false;
}
- if (className != null ? !className.equals(that.className) : that.className != null) {
+ if (!Objects.equals(className, that.className)) {
return false;
}
- return methodName != null ? methodName.equals(that.methodName) : that.methodName == null;
+ return Objects.equals(methodName, that.methodName);
Review Comment:
It can also be improved
--
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: issues-unsubscribe@streampark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org