AppChecker created GEODE-2551:
---------------------------------

             Summary: Possible bugs in the source code
                 Key: GEODE-2551
                 URL: https://issues.apache.org/jira/browse/GEODE-2551
             Project: Geode
          Issue Type: Bug
            Reporter: AppChecker


Hello!

We've checked your project with [static code analyzer 
AppChecker|https://cnpo.ru/en/solutions/appchecker.php]
It found several possible defects in the source code:
1) 
https://github.com/apache/geode/blob/8bf39571471642beaaa36c9626a61a90bd3803c2/geode-core/src/main/java/org/apache/geode/management/internal/cli/parser/ParserUtils.java#L96
{code:java}
if ((split[i].endsWith("\"") && split[i].endsWith("\""))
            || (split[i].startsWith("\'") && split[i].endsWith("\'"))) {
{code}
{noformat}split[i].endsWith("\"") {noformat} is checked twice.
Probably it should be:
{code:java}
if ((split[i].startsWith("\"") && split[i].endsWith("\""))
            || (split[i].startsWith("\'") && split[i].endsWith("\'"))) {
{code}

2) 
https://github.com/apache/geode/blob/6e5013102927099a725282b6bad5d64a79152fab/geode-core/src/test/java/org/apache/geode/cache/query/dunit/SelectStarQueryDUnitTest.java#L1384
https://github.com/apache/geode/blob/6e5013102927099a725282b6bad5d64a79152fab/geode-core/src/test/java/org/apache/geode/cache/query/dunit/SelectStarQueryDUnitTest.java#L1444
{code:java}
else if (rs instanceof PortfolioPdx || rs instanceof PortfolioPdx) {
{code}
rs is checked twice

3) 
https://github.com/apache/geode/blob/8bf39571471642beaaa36c9626a61a90bd3803c2/geode-core/src/main/java/org/apache/geode/management/internal/cli/util/JsonUtil.java#L388
{code:java}
    } else if (klass.isAssignableFrom(Float.class) || 
klass.isAssignableFrom(Float.class)) {

{code}
klass.isAssignableFrom(Float.class)  is checked twcie





--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to