commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oliver Zeigermann <oliver.zeigerm...@gmail.com>
Subject Re: [transaction] errors in commits to FileHelper
Date Fri, 13 Jan 2006 18:34:46 GMT
OK. Obviously, you were right in (1) and (3). Fixed that - please check!

Could you elabore on (2)? Why do you think

if (!targetFile.exists()) {

is obsolete? How could I find out if creation has failed without this check?

Quoting from Javadoc of File.mkdirs:

<<Returns:
    true if and only if the directory was created, along with all
necessary parent directories; false otherwise>>

So, if it already existed, this method would also return true. Which
certainly is no error condition, right?

Am I wrong again?

Oliver

2006/1/13, Joerg Heinicke <joerg.heinicke@gmx.de>:
> Another strange things in commits, this time the latest 3 commits to FileHelper:
>
> 1. http://svn.apache.org/viewcvs.cgi/jakarta/commons/proper/transaction/trunk/
> src/java/org/apache/commons/transaction/util/FileHelper.java
> ?rev=349996&r1=155433&r2=349996&diff_format=h
>
> Shouldn't it be
>
> if ( ! targetFile.mkdirs()) {
> -----^-----
>
> 2. http://svn.apache.org/viewcvs.cgi/jakarta/commons/proper/transaction/trunk/
> src/java/org/apache/commons/transaction/util/FileHelper.java
> ?rev=349997&r1=349996&r2=349997&diff_format=h
>
> Fixing the above makes probably this commit obsolete. At least it would no
> longer be a fix to fix, which only hides the problem in many cases, but might be
> an optimization.
>
> 3. http://svn.apache.org/viewcvs.cgi/jakarta/commons/proper/transaction/trunk/
> src/java/org/apache/commons/transaction/util/FileHelper.java
> ?rev=350000&r1=349997&r2=350000&diff_format=h
>
> Same like 1., again a missing ! I think.
>
> WDYT?
>
> Jörg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
>

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


Mime
View raw message