polygene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "songwanging (JIRA)" <j...@apache.org>
Subject [jira] [Created] (POLYGENE-286) If and else-if branches has the same condition
Date Fri, 08 Dec 2017 16:29:00 GMT
songwanging created POLYGENE-286:

             Summary: If and else-if branches has the same condition
                 Key: POLYGENE-286
                 URL: https://issues.apache.org/jira/browse/POLYGENE-286
             Project: Polygene
          Issue Type: Bug
    Affects Versions: 3.0.0
            Reporter: songwanging
            Priority: Minor

Our tool DeepTect has detected a piece of buggy code snippet, in which the if and else branches
has the same condition.

Path: polygene-java/libraries/restlet/src/main/java/org/apache/polygene/library/restlet/serialization/PolygeneConverter.java

 protected <T> Representation create( Representation source, Class<T> objectClass
        if( VARIANT_WWW_FORM_URLENCODED.isCompatible( source ) )
            return objectFactory.newObject( FormRepresentation.class, source, objectClass
        else if( VARIANT_WWW_FORM_URLENCODED.isCompatible( source ) )
            //noinspection unchecked
            return objectFactory.newObject( JsonRepresentation.class, source, objectClass
        return null;

This message was sent by Atlassian JIRA

View raw message