You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@polygene.apache.org by "Niclas Hedhman (JIRA)" <ji...@apache.org> on 2017/12/09 05:54:02 UTC

[jira] [Resolved] (POLYGENE-286) If and else-if branches has the same condition

     [ https://issues.apache.org/jira/browse/POLYGENE-286?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Niclas Hedhman resolved POLYGENE-286.
-------------------------------------
       Resolution: Fixed
         Assignee: Niclas Hedhman
    Fix Version/s: 3.1.0


Fixed in commit e8abe045fd616280029c31ec7b7049ecf02675e3

> 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
>            Assignee: Niclas Hedhman
>            Priority: Minor
>             Fix For: 3.1.0
>
>
> 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
> {code: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;
>     }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)