You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Joerg Heinicke <jo...@gmx.de> on 2006/01/13 18:28:16 UTC

[transaction] errors in commits to FileHelper

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


Re: [transaction] errors in commits to FileHelper

Posted by Oliver Zeigermann <ol...@gmail.com>.
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 <jo...@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


Re: [transaction] errors in commits to FileHelper

Posted by Oliver Zeigermann <ol...@gmail.com>.
Could all well be - you are probably right - as before ;)

Those were mere quick proposals to an issue another guy was raising in
the mailing list.

I will check ASAP.

Oliver

2006/1/13, Joerg Heinicke <jo...@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