@@ -440,9 +440,6 @@ public class Main implements AntMain { | |||||
if (searchForFile) { | if (searchForFile) { | ||||
if (searchForThis != null) { | if (searchForThis != null) { | ||||
buildFile = findBuildFile(System.getProperty("user.dir"), searchForThis); | buildFile = findBuildFile(System.getProperty("user.dir"), searchForThis); | ||||
if (buildFile == null) { | |||||
throw new BuildException("Could not locate a build file!"); | |||||
} | |||||
} else { | } else { | ||||
// no search file specified: so search an existing default file | // no search file specified: so search an existing default file | ||||
final Iterator<ProjectHelper> it = ProjectHelperRepository.getInstance().getHelpers(); | final Iterator<ProjectHelper> it = ProjectHelperRepository.getInstance().getHelpers(); | ||||
@@ -454,9 +451,9 @@ public class Main implements AntMain { | |||||
} | } | ||||
buildFile = findBuildFile(System.getProperty("user.dir"), searchForThis); | buildFile = findBuildFile(System.getProperty("user.dir"), searchForThis); | ||||
} while (buildFile == null && it.hasNext()); | } while (buildFile == null && it.hasNext()); | ||||
if (buildFile == null) { | |||||
throw new BuildException("Could not locate a build file!"); | |||||
} | |||||
} | |||||
if (buildFile == null) { | |||||
throw new BuildException("Could not locate a build file!"); | |||||
} | } | ||||
} else { | } else { | ||||
// no build file specified: so search an existing default file | // no build file specified: so search an existing default file | ||||
@@ -1048,12 +1048,11 @@ public class PropertyHelper implements GetProperty { | |||||
if (value.charAt(pos + 1) == '$') { | if (value.charAt(pos + 1) == '$') { | ||||
//backwards compatibility two $ map to one mode | //backwards compatibility two $ map to one mode | ||||
fragments.addElement("$"); | fragments.addElement("$"); | ||||
prev = pos + 2; | |||||
} else { | } else { | ||||
//new behaviour: $X maps to $X for all values of X!='$' | //new behaviour: $X maps to $X for all values of X!='$' | ||||
fragments.addElement(value.substring(pos, pos + 2)); | fragments.addElement(value.substring(pos, pos + 2)); | ||||
prev = pos + 2; | |||||
} | } | ||||
prev = pos + 2; | |||||
} else { | } else { | ||||
//property found, extract its name or bail on a typo | //property found, extract its name or bail on a typo | ||||
int endName = value.indexOf('}', pos); | int endName = value.indexOf('}', pos); | ||||
@@ -282,8 +282,6 @@ public class CommonsLoggingListener implements BuildListener, BuildLogger { | |||||
} | } | ||||
break; | break; | ||||
case Project.MSG_VERBOSE: | case Project.MSG_VERBOSE: | ||||
log.debug(message); | |||||
break; | |||||
case Project.MSG_DEBUG: | case Project.MSG_DEBUG: | ||||
log.debug(message); | log.debug(message); | ||||
break; | break; | ||||
@@ -155,8 +155,6 @@ public class Log4jListener implements BuildListener { | |||||
log.info(event.getMessage()); | log.info(event.getMessage()); | ||||
break; | break; | ||||
case Project.MSG_VERBOSE: | case Project.MSG_VERBOSE: | ||||
log.debug(event.getMessage()); | |||||
break; | |||||
case Project.MSG_DEBUG: | case Project.MSG_DEBUG: | ||||
log.debug(event.getMessage()); | log.debug(event.getMessage()); | ||||
break; | break; | ||||
@@ -72,13 +72,11 @@ public class KeySubst extends Task { | |||||
String newline = null; | String newline = null; | ||||
line = br.readLine(); | line = br.readLine(); | ||||
while (line != null) { | while (line != null) { | ||||
if (line.isEmpty()) { | |||||
bw.newLine(); | |||||
} else { | |||||
if (!line.isEmpty()) { | |||||
newline = KeySubst.replace(line, replacements); | newline = KeySubst.replace(line, replacements); | ||||
bw.write(newline); | bw.write(newline); | ||||
bw.newLine(); | |||||
} | } | ||||
bw.newLine(); | |||||
line = br.readLine(); | line = br.readLine(); | ||||
} | } | ||||
bw.flush(); | bw.flush(); | ||||
@@ -623,10 +623,8 @@ public class Zip extends MatchingTask { | |||||
skipWriting = true; | skipWriting = true; | ||||
executeMain(); | executeMain(); | ||||
skipWriting = false; | skipWriting = false; | ||||
executeMain(); | |||||
} else { | |||||
executeMain(); | |||||
} | } | ||||
executeMain(); | |||||
} | } | ||||
/** | /** | ||||
@@ -136,8 +136,6 @@ public class Http extends ProjectComponent implements Condition { | |||||
} catch (ProtocolException pe) { | } catch (ProtocolException pe) { | ||||
throw new BuildException("Invalid HTTP protocol: " | throw new BuildException("Invalid HTTP protocol: " | ||||
+ requestMethod, pe); | + requestMethod, pe); | ||||
} catch (SocketTimeoutException ste) { | |||||
return false; | |||||
} catch (IOException e) { | } catch (IOException e) { | ||||
return false; | return false; | ||||
} | } | ||||
@@ -64,6 +64,10 @@ class ConstantPool { | |||||
break; | break; | ||||
case INTEGER : | case INTEGER : | ||||
case FIELDREF : | |||||
case METHODREF : | |||||
case INTERFACEMETHODREF : | |||||
case NAMEANDTYPE : | |||||
values[i] = data.readInt(); | values[i] = data.readInt(); | ||||
break; | break; | ||||
@@ -86,12 +90,6 @@ class ConstantPool { | |||||
values[i] = data.readUnsignedShort(); | values[i] = data.readUnsignedShort(); | ||||
break; | break; | ||||
case FIELDREF : | |||||
case METHODREF : | |||||
case INTERFACEMETHODREF : | |||||
case NAMEANDTYPE : | |||||
values[i] = data.readInt(); | |||||
break; | |||||
default: | default: | ||||
// Do nothing | // Do nothing | ||||
} | } | ||||
@@ -561,9 +561,6 @@ public class FTP extends Task implements FTPTaskConfig { | |||||
} | } | ||||
ftp.changeToParentDirectory(); | ftp.changeToParentDirectory(); | ||||
} catch (FTPConnectionClosedException ftpcce) { | |||||
throw new BuildException("Error while communicating with FTP " | |||||
+ "server: ", ftpcce); | |||||
} catch (IOException e) { | } catch (IOException e) { | ||||
throw new BuildException("Error while communicating with FTP " | throw new BuildException("Error while communicating with FTP " | ||||
+ "server: ", e); | + "server: ", e); | ||||
@@ -2535,16 +2532,12 @@ public class FTP extends Task implements FTPTaskConfig { | |||||
if (binary) { | if (binary) { | ||||
ftp.setFileType(org.apache.commons.net.ftp.FTP.BINARY_FILE_TYPE); | ftp.setFileType(org.apache.commons.net.ftp.FTP.BINARY_FILE_TYPE); | ||||
if (!FTPReply.isPositiveCompletion(ftp.getReplyCode())) { | |||||
throw new BuildException("could not set transfer type: %s", | |||||
ftp.getReplyString()); | |||||
} | |||||
} else { | } else { | ||||
ftp.setFileType(org.apache.commons.net.ftp.FTP.ASCII_FILE_TYPE); | ftp.setFileType(org.apache.commons.net.ftp.FTP.ASCII_FILE_TYPE); | ||||
if (!FTPReply.isPositiveCompletion(ftp.getReplyCode())) { | |||||
throw new BuildException("could not set transfer type: %s", | |||||
ftp.getReplyString()); | |||||
} | |||||
} | |||||
if (!FTPReply.isPositiveCompletion(ftp.getReplyCode())) { | |||||
throw new BuildException("could not set transfer type: %s", | |||||
ftp.getReplyString()); | |||||
} | } | ||||
if (passive) { | if (passive) { | ||||
@@ -1812,16 +1812,12 @@ public class FTPTaskMirrorImpl implements FTPTaskMirror { | |||||
if (task.isBinary()) { | if (task.isBinary()) { | ||||
ftp.setFileType(org.apache.commons.net.ftp.FTP.BINARY_FILE_TYPE); | ftp.setFileType(org.apache.commons.net.ftp.FTP.BINARY_FILE_TYPE); | ||||
if (!FTPReply.isPositiveCompletion(ftp.getReplyCode())) { | |||||
throw new BuildException("could not set transfer type: %s", | |||||
ftp.getReplyString()); | |||||
} | |||||
} else { | } else { | ||||
ftp.setFileType(org.apache.commons.net.ftp.FTP.ASCII_FILE_TYPE); | ftp.setFileType(org.apache.commons.net.ftp.FTP.ASCII_FILE_TYPE); | ||||
if (!FTPReply.isPositiveCompletion(ftp.getReplyCode())) { | |||||
throw new BuildException("could not set transfer type: %s", | |||||
ftp.getReplyString()); | |||||
} | |||||
} | |||||
if (!FTPReply.isPositiveCompletion(ftp.getReplyCode())) { | |||||
throw new BuildException("could not set transfer type: %s", | |||||
ftp.getReplyString()); | |||||
} | } | ||||
if (task.isPassive()) { | if (task.isPassive()) { | ||||
@@ -115,16 +115,11 @@ public class DependencyVisitor extends EmptyVisitor { | |||||
// is upper case ascii. so according to the spec it's an inner class | // is upper case ascii. so according to the spec it's an inner class | ||||
classname = classname.substring(0, index) + "$" | classname = classname.substring(0, index) + "$" | ||||
+ classname.substring(index + 1); | + classname.substring(index + 1); | ||||
addClass(classname); | |||||
} else { | |||||
// Add the class in dotted notation 'com.company.Class' | |||||
addClass(classname); | |||||
} | } | ||||
// CheckStyle:MagicNumber ON | // CheckStyle:MagicNumber ON | ||||
} else { | |||||
// Add a class with no package 'Class' | |||||
addClass(classname); | |||||
} | } | ||||
// Add the class, with or without the package name | |||||
addClass(classname); | |||||
} | } | ||||
} | } | ||||