diff --git a/WHATSNEW b/WHATSNEW index 79d86514d..95bb5f597 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -28,6 +28,9 @@ Fixed bugs: * ignored the append attribute, Bugzilla Report 26137. +* The gcj compiler adapter for failed if the destination + directory didn't exist. Bugzilla Report 25856. + Other changes: -------------- * Translate task logs a debug message specifying the number of files diff --git a/src/main/org/apache/tools/ant/taskdefs/compilers/Gcj.java b/src/main/org/apache/tools/ant/taskdefs/compilers/Gcj.java index da440566a..ac98f174a 100644 --- a/src/main/org/apache/tools/ant/taskdefs/compilers/Gcj.java +++ b/src/main/org/apache/tools/ant/taskdefs/compilers/Gcj.java @@ -1,7 +1,7 @@ /* * The Apache Software License, Version 1.1 * - * Copyright (c) 2001-2003 The Apache Software Foundation. All rights + * Copyright (c) 2001-2004 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without @@ -119,10 +119,10 @@ public class Gcj extends DefaultCompilerAdapter { cmd.createArgument().setValue("-d"); cmd.createArgument().setFile(destDir); - if (destDir.mkdirs()) { + if (!destDir.exists() && !destDir.mkdirs()) { throw new BuildException("Can't make output directories. " + "Maybe permission is wrong. "); - }; + } } cmd.createArgument().setValue("-classpath");