Browse Source

checkstyle: make method a little smaller

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@490602 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 18 years ago
parent
commit
3ed946bae4
1 changed files with 8 additions and 8 deletions
  1. +8
    -8
      src/main/org/apache/tools/ant/taskdefs/email/EmailTask.java

+ 8
- 8
src/main/org/apache/tools/ant/taskdefs/email/EmailTask.java View File

@@ -420,9 +420,7 @@ public class EmailTask extends Task {
autoFound = true;
log("Using MIME mail", Project.MSG_VERBOSE);
} catch (BuildException e) {
Throwable t = e.getCause() == null ? e : e.getCause();
log("Failed to initialise MIME mail: " + t.getMessage(),
Project.MSG_WARN);
logBuildException("Failed to initialise MIME mail: ", e);
return;
}
}
@@ -446,9 +444,7 @@ public class EmailTask extends Task {
autoFound = true;
log("Using UU mail", Project.MSG_VERBOSE);
} catch (BuildException e) {
Throwable t = e.getCause() == null ? e : e.getCause();
log("Failed to initialise UU mail: " + t.getMessage(),
Project.MSG_WARN);
logBuildException("Failed to initialise UU mail: ", e);
return;
}
}
@@ -540,8 +536,7 @@ public class EmailTask extends Task {
log("Sent email with " + count + " attachment"
+ (count == 1 ? "" : "s"), Project.MSG_INFO);
} catch (BuildException e) {
Throwable t = e.getCause() == null ? e : e.getCause();
log("Failed to send email: " + t.getMessage(), Project.MSG_WARN);
logBuildException("Failed to send email: ", e);
if (failOnError) {
throw e;
}
@@ -555,6 +550,11 @@ public class EmailTask extends Task {
}
}

private void logBuildException(String reason, BuildException e) {
Throwable t = e.getCause() == null ? e : e.getCause();
log(reason + t.getMessage(), Project.MSG_WARN);
}

/**
* Sets the character set of mail message.
* Will be ignored if mimeType contains ....; Charset=... substring or


Loading…
Cancel
Save