You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by sebb <se...@gmail.com> on 2013/03/07 16:36:27 UTC
Re: svn commit: r1453831 - /commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/disk/DiskFileItem.java
On 7 March 2013 12:52, <si...@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-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org