From f47e4095c872219cfb2054556307c5c12cbb2b81 Mon Sep 17 00:00:00 2001 From: Steve Loughran Date: Thu, 22 Nov 2007 12:43:25 +0000 Subject: [PATCH] Bug 43936: errors are unhelpful git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@597397 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/tools/ant/taskdefs/FixCRLF.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java b/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java index 9ae1eaa56..b8946edc3 100644 --- a/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java +++ b/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java @@ -83,9 +83,10 @@ import org.apache.tools.ant.util.FileUtils; public class FixCRLF extends MatchingTask implements ChainableReader { + private static final String FIXCRLF_ERROR = " error: "; /** error string for using srcdir and file */ public static final String ERROR_FILE_AND_SRCDIR - = "srcdir and file are mutually exclusive"; + =FIXCRLF_ERROR+"srcdir and file are mutually exclusive"; private static final FileUtils FILE_UTILS = FileUtils.getFileUtils(); @@ -106,6 +107,7 @@ public class FixCRLF extends MatchingTask implements ChainableReader { */ private String outputEncoding = null; + /** * Chain this task as a reader. * @param rdr Reader to chain. @@ -312,20 +314,20 @@ public class FixCRLF extends MatchingTask implements ChainableReader { srcDir = file.getParentFile(); } if (srcDir == null) { - throw new BuildException("srcdir attribute must be set!"); + throw new BuildException(FIXCRLF_ERROR +"srcdir attribute must be set!"); } if (!srcDir.exists()) { - throw new BuildException("srcdir does not exist!"); + throw new BuildException(FIXCRLF_ERROR +"srcdir does not exist: '"+srcDir+"'"); } if (!srcDir.isDirectory()) { - throw new BuildException("srcdir is not a directory!"); + throw new BuildException(FIXCRLF_ERROR +"srcdir is not a directory: '"+srcDir+"'"); } if (destDir != null) { if (!destDir.exists()) { - throw new BuildException("destdir does not exist!"); + throw new BuildException(FIXCRLF_ERROR +"destdir does not exist: '" + destDir + "'"); } if (!destDir.isDirectory()) { - throw new BuildException("destdir is not a directory!"); + throw new BuildException(FIXCRLF_ERROR +"destdir is not a directory: '" + destDir + "'"); } } }