GitHub user VampireAchao edited a comment on the discussion: StreamPark 
code-style-and-quality Improve

Branch handling leads to redundant lines, making the code less concise.

```java
org.apache.streampark.console.base.mybatis.interceptor.PostgreSQLQueryInterceptor#intercept

        CacheKey cacheKey;
    BoundSql boundSql;
    if (args.length == 4) {
      boundSql = ms.getBoundSql(parameter);
      cacheKey = executor.createCacheKey(ms, parameter, rowBounds, boundSql);
    } else {
      cacheKey = (CacheKey) args[4];
      boundSql = (BoundSql) args[5];
    }


->>

        boolean fourLen = args.length == 4;
    BoundSql boundSql = fourLen ? ms.getBoundSql(parameter) : (BoundSql) 
args[5];
    CacheKey cacheKey =
        fourLen ? executor.createCacheKey(ms, parameter, rowBounds, boundSql) : 
(CacheKey) args[4];
    
```

GitHub link: 
https://github.com/apache/incubator-streampark/discussions/2915#discussioncomment-6623995

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]

Reply via email to