diff --git a/src/main/org/apache/tools/ant/taskdefs/BuildNumber.java b/src/main/org/apache/tools/ant/taskdefs/BuildNumber.java index 32f819c4d..1367c64f8 100644 --- a/src/main/org/apache/tools/ant/taskdefs/BuildNumber.java +++ b/src/main/org/apache/tools/ant/taskdefs/BuildNumber.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 The Apache Software Foundation + * Copyright 2002-2006 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -129,7 +129,6 @@ public class BuildNumber } catch (final NumberFormatException nfe) { final String message = myFile + " contains a non integer build number: " + buildNumber; - throw new BuildException(message, nfe); } } @@ -173,7 +172,7 @@ public class BuildNumber private void validate() throws BuildException { if (null == myFile) { - myFile = getProject().resolveFile(DEFAULT_FILENAME); + myFile = FILE_UTILS.resolveFile(getProject().getBaseDir(), DEFAULT_FILENAME); } if (!myFile.exists()) { @@ -182,20 +181,17 @@ public class BuildNumber } catch (final IOException ioe) { final String message = myFile + " doesn't exist and new file can't be created."; - throw new BuildException(message, ioe); } } if (!myFile.canRead()) { final String message = "Unable to read from " + myFile + "."; - throw new BuildException(message); } if (!myFile.canWrite()) { final String message = "Unable to write to " + myFile + "."; - throw new BuildException(message); } }