On 7 March 2013 12:52,  <simonetrip...@apache.org> wrote:
> Author: simonetripodi
> Date: Thu Mar  7 12:52:04 2013
> New Revision: 1453831
>
> URL: http://svn.apache.org/r1453831
> Log:
> checkstyle: Avoid inline conditionals.

I think Checkstyle is wrong in this case.

> Modified:
>     
> commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/disk/DiskFileItem.java
>
> Modified: 
> commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/disk/DiskFileItem.java
> URL: 
> http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/disk/DiskFileItem.java?rev=1453831&r1=1453830&r2=1453831&view=diff
> ==============================================================================
> --- 
> commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/disk/DiskFileItem.java
>  (original)
> +++ 
> commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/disk/DiskFileItem.java
>  Thu Mar  7 12:52:04 2013
> @@ -554,7 +554,10 @@ public class DiskFileItem
>       *         memory.
>       */
>      public File getStoreLocation() {
> -        return dfos == null ? null : dfos.getFile();
> +        if (dfos == null) {
> +            return null;
> +        }
> +        return dfos.getFile();

IMO the inline conditional is simpler and easier to understand - in
this particular case.

There will be some inline conditionals which are better expanded, but
this is not one of them.

Checkstyle is not always correct ...

>      }
>
>      // ------------------------------------------------------ Protected 
> methods
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to