From c4266e92503f9365db8450324de2709fe4ff5423 Mon Sep 17 00:00:00 2001
From: Conor MacNeill ProcessDestroyer
and registers it as
* a shutdown hook.
*/
- public ProcessDestroyer()
- {
- try
- {
+ public ProcessDestroyer() {
+ try {
// check to see if the method exists (support pre-JDK 1.3 VMs)
//
Class[] paramTypes = {Thread.class};
@@ -88,9 +85,7 @@ class ProcessDestroyer
//
Object[] args = {this};
addShutdownHook.invoke(Runtime.getRuntime(), args);
- }
- catch (Exception e)
- {
+ } catch (Exception e) {
// it just won't be added as a shutdown hook... :(
}
}
@@ -103,8 +98,7 @@ class ProcessDestroyer
* @return true
if the specified Process
was
* successfully added
*/
- public boolean add(Process process)
- {
+ public boolean add(Process process) {
processes.addElement(process);
return processes.contains(process);
}
@@ -117,21 +111,17 @@ class ProcessDestroyer
* @return true
if the specified Process
was
* successfully removed
*/
- public boolean remove(Process process)
- {
+ public boolean remove(Process process) {
return processes.removeElement(process);
}
/**
* Invoked by the VM when it is exiting.
*/
- public void run()
- {
- synchronized (processes)
- {
+ public void run() {
+ synchronized (processes) {
Enumeration e = processes.elements();
- while (e.hasMoreElements())
- {
+ while (e.hasMoreElements()) {
((Process) e.nextElement()).destroy();
}
}
diff --git a/src/main/org/apache/tools/ant/taskdefs/Property.java b/src/main/org/apache/tools/ant/taskdefs/Property.java
index 1544ba224..f40ac7122 100644
--- a/src/main/org/apache/tools/ant/taskdefs/Property.java
+++ b/src/main/org/apache/tools/ant/taskdefs/Property.java
@@ -377,8 +377,7 @@ public class Property extends Task {
if (props.containsKey(propertyName)) {
fragment = props.getProperty(propertyName);
resolved = false;
- }
- else {
+ } else {
fragment = "${" + propertyName + "}";
}
}
diff --git a/src/main/org/apache/tools/ant/taskdefs/Replace.java b/src/main/org/apache/tools/ant/taskdefs/Replace.java
index 9fcb639c1..b7aa9cd2a 100644
--- a/src/main/org/apache/tools/ant/taskdefs/Replace.java
+++ b/src/main/org/apache/tools/ant/taskdefs/Replace.java
@@ -126,8 +126,7 @@ public class Replace extends MatchingTask {
}
//Inner class
- public class Replacefilter
- {
+ public class Replacefilter {
private String token;
private String value;
private String property;
@@ -173,18 +172,14 @@ public class Replace extends MatchingTask {
}
}
- public String getReplaceValue()
- {
+ public String getReplaceValue() {
if (property != null) {
return properties.getProperty(property);
- }
- else if (value != null) {
+ } else if (value != null) {
return value;
- }
- else if (Replace.this.value != null) {
+ } else if (Replace.this.value != null) {
return Replace.this.value.getText();
- }
- else {
+ } else {
//Default is empty string
return new String("");
}
@@ -319,13 +314,11 @@ public class Replace extends MatchingTask {
try {
properties.load(new FileInputStream(propertyFile));
- }
- catch (FileNotFoundException e) {
+ } catch (FileNotFoundException e) {
String message = "Property file (" + propertyFile.getPath()
+ ") not found.";
throw new BuildException(message);
- }
- catch (IOException e) {
+ } catch (IOException e) {
String message = "Property file (" + propertyFile.getPath()
+ ") cannot be loaded.";
throw new BuildException(message);
@@ -384,8 +377,7 @@ public class Replace extends MatchingTask {
//Preserve original string (buf) so we can compare the result
String newString = new String(buf);
- if (token != null)
- {
+ if (token != null) {
// line separators in values and tokens are "\n"
// in order to compare with the file contents, replace them
// as needed
diff --git a/src/main/org/apache/tools/ant/taskdefs/SQLExec.java b/src/main/org/apache/tools/ant/taskdefs/SQLExec.java
index 1a9ad2aa6..36d5a10d0 100644
--- a/src/main/org/apache/tools/ant/taskdefs/SQLExec.java
+++ b/src/main/org/apache/tools/ant/taskdefs/SQLExec.java
@@ -484,8 +484,7 @@ public class SQLExec extends Task {
}
}
dc = loader.loadClass(driver);
- }
- else {
+ } else {
log("Loading " + driver + " using system loader.",
Project.MSG_VERBOSE);
dc = Class.forName(driver);
@@ -568,8 +567,7 @@ public class SQLExec extends Task {
conn.commit();
}
}
- }
- finally {
+ } finally {
if (out != null && out != System.out) {
out.close();
}
@@ -588,8 +586,7 @@ public class SQLExec extends Task {
} catch (SQLException ex) {}
}
throw new BuildException(e, location);
- }
- finally {
+ } finally {
try {
if (statement != null) {
statement.close();
@@ -597,8 +594,7 @@ public class SQLExec extends Task {
if (conn != null) {
conn.close();
}
- }
- catch (SQLException e) {}
+ } catch (SQLException e) {}
}
log(goodSql + " of " + totalSql +
@@ -697,8 +693,7 @@ public class SQLExec extends Task {
return false;
}
}
- }
- catch (SQLException e) {
+ } catch (SQLException e) {
// Could not get the required information
log("Failed to obtain required RDBMS information", Project.MSG_ERR);
return false;
@@ -721,8 +716,7 @@ public class SQLExec extends Task {
if (!statement.execute(sql)) {
log(statement.getUpdateCount() + " rows affected",
Project.MSG_VERBOSE);
- }
- else {
+ } else {
if (print) {
printResults(out);
}
@@ -735,8 +729,7 @@ public class SQLExec extends Task {
}
conn.clearWarnings();
goodSql++;
- }
- catch (SQLException e) {
+ } catch (SQLException e) {
log("Failed to execute: " + sql, Project.MSG_ERR);
if (!onError.equals("continue")) {
throw e;
@@ -776,8 +769,7 @@ public class SQLExec extends Task {
if (first) {
first = false;
- }
- else {
+ } else {
line.append(",");
}
line.append(columnValue);
diff --git a/src/main/org/apache/tools/ant/taskdefs/SendEmail.java b/src/main/org/apache/tools/ant/taskdefs/SendEmail.java
index eb89dc900..3c8e1dfdc 100644
--- a/src/main/org/apache/tools/ant/taskdefs/SendEmail.java
+++ b/src/main/org/apache/tools/ant/taskdefs/SendEmail.java
@@ -110,8 +110,7 @@ import org.apache.tools.ant.taskdefs.email.EmailTask;
*
* @ant.task name="mail" category="network"
*/
-public class SendEmail extends EmailTask
-{
+public class SendEmail extends EmailTask {
/**
* Sets the mailport parameter of this build task.
* @param value mail port name.
diff --git a/src/main/org/apache/tools/ant/taskdefs/Sleep.java b/src/main/org/apache/tools/ant/taskdefs/Sleep.java
index f7e90ef46..b4cdfcdb3 100644
--- a/src/main/org/apache/tools/ant/taskdefs/Sleep.java
+++ b/src/main/org/apache/tools/ant/taskdefs/Sleep.java
@@ -145,8 +145,7 @@ public class Sleep extends Task {
public void doSleep(long millis) {
try {
Thread.sleep(millis);
- }
- catch (InterruptedException ie) {
+ } catch (InterruptedException ie) {
}
}
@@ -201,12 +200,10 @@ public class Sleep extends Task {
log("sleeping for " + sleepTime + " milliseconds",
Project.MSG_VERBOSE);
doSleep(sleepTime);
- }
- catch (Exception e) {
+ } catch (Exception e) {
if (failOnError) {
throw new BuildException(e);
- }
- else {
+ } else {
String text = e.toString();
log(text, Project.MSG_ERR);
}
diff --git a/src/main/org/apache/tools/ant/taskdefs/StreamPumper.java b/src/main/org/apache/tools/ant/taskdefs/StreamPumper.java
index 6197251ef..1c5443816 100644
--- a/src/main/org/apache/tools/ant/taskdefs/StreamPumper.java
+++ b/src/main/org/apache/tools/ant/taskdefs/StreamPumper.java
@@ -130,8 +130,7 @@ public class StreamPumper implements Runnable {
* @see #isFinished()
**/
public synchronized void waitFor()
- throws InterruptedException
- {
+ throws InterruptedException {
while (!isFinished()) {
wait();
}
diff --git a/src/main/org/apache/tools/ant/taskdefs/Tar.java b/src/main/org/apache/tools/ant/taskdefs/Tar.java
index c730a6b25..9fd21fc8b 100644
--- a/src/main/org/apache/tools/ant/taskdefs/Tar.java
+++ b/src/main/org/apache/tools/ant/taskdefs/Tar.java
@@ -261,12 +261,10 @@ public class Tar extends MatchingTask {
tOut.setDebug(true);
if (longFileMode.isTruncateMode()) {
tOut.setLongFileMode(TarOutputStream.LONGFILE_TRUNCATE);
- }
- else if (longFileMode.isFailMode() ||
+ } else if (longFileMode.isFailMode() ||
longFileMode.isOmitMode()) {
tOut.setLongFileMode(TarOutputStream.LONGFILE_ERROR);
- }
- else {
+ } else {
// warn or GNU
tOut.setLongFileMode(TarOutputStream.LONGFILE_GNU);
}
@@ -296,8 +294,7 @@ public class Tar extends MatchingTask {
try {
// close up
tOut.close();
- }
- catch (IOException e) {}
+ } catch (IOException e) {}
}
}
} finally {
@@ -307,8 +304,7 @@ public class Tar extends MatchingTask {
protected void tarFile(File file, TarOutputStream tOut, String vPath,
TarFileSet tarFileSet)
- throws IOException
- {
+ throws IOException {
FileInputStream fIn = null;
String fullpath = tarFileSet.getFullpath();
diff --git a/src/main/org/apache/tools/ant/taskdefs/Tstamp.java b/src/main/org/apache/tools/ant/taskdefs/Tstamp.java
index 1f2c6a3ad..769b8ec5e 100644
--- a/src/main/org/apache/tools/ant/taskdefs/Tstamp.java
+++ b/src/main/org/apache/tools/ant/taskdefs/Tstamp.java
@@ -121,15 +121,13 @@ public class Tstamp extends Task {
}
}
- public CustomFormat createFormat()
- {
+ public CustomFormat createFormat() {
CustomFormat cts = new CustomFormat(prefix);
customFormats.addElement(cts);
return cts;
}
- public class CustomFormat
- {
+ public class CustomFormat {
private TimeZone timeZone;
private String propertyName;
private String pattern;
@@ -140,23 +138,19 @@ public class Tstamp extends Task {
private int field = Calendar.DATE;
private String prefix = "";
- public CustomFormat(String prefix)
- {
+ public CustomFormat(String prefix) {
this.prefix = prefix;
}
- public void setProperty(String propertyName)
- {
+ public void setProperty(String propertyName) {
this.propertyName = prefix + propertyName;
}
- public void setPattern(String pattern)
- {
+ public void setPattern(String pattern) {
this.pattern = pattern;
}
- public void setLocale(String locale)
- {
+ public void setLocale(String locale) {
StringTokenizer st = new StringTokenizer(locale, " \t\n\r\f,");
try {
language = st.nextToken();
@@ -169,12 +163,10 @@ public class Tstamp extends Task {
getLocation());
}
}
- }
- else {
+ } else {
country = "";
}
- }
- catch (NoSuchElementException e) {
+ } catch (NoSuchElementException e) {
throw new BuildException("bad locale format", e,
getLocation());
}
@@ -207,8 +199,7 @@ public class Tstamp extends Task {
field = unit.getCalendarField();
}
- public void execute(Project project, Date date, Location location)
- {
+ public void execute(Project project, Date date, Location location) {
if (propertyName == null) {
throw new BuildException("property attribute must be provided",
location);
@@ -222,12 +213,10 @@ public class Tstamp extends Task {
SimpleDateFormat sdf;
if (language == null) {
sdf = new SimpleDateFormat(pattern);
- }
- else if (variant == null) {
+ } else if (variant == null) {
sdf = new SimpleDateFormat(pattern,
new Locale(language, country));
- }
- else {
+ } else {
sdf = new SimpleDateFormat(pattern,
new Locale(language, country,
variant));
diff --git a/src/main/org/apache/tools/ant/taskdefs/Untar.java b/src/main/org/apache/tools/ant/taskdefs/Untar.java
index 8d79eede1..8a332092e 100644
--- a/src/main/org/apache/tools/ant/taskdefs/Untar.java
+++ b/src/main/org/apache/tools/ant/taskdefs/Untar.java
@@ -97,8 +97,7 @@ public class Untar extends Expand {
if (tis != null) {
try {
tis.close();
- }
- catch (IOException e) {}
+ } catch (IOException e) {}
}
}
}
diff --git a/src/main/org/apache/tools/ant/taskdefs/War.java b/src/main/org/apache/tools/ant/taskdefs/War.java
index 632b73e6a..fa44dd718 100644
--- a/src/main/org/apache/tools/ant/taskdefs/War.java
+++ b/src/main/org/apache/tools/ant/taskdefs/War.java
@@ -128,8 +128,7 @@ public class War extends Jar {
}
protected void initZipOutputStream(ZipOutputStream zOut)
- throws IOException, BuildException
- {
+ throws IOException, BuildException {
// If no webxml file is specified, it's an error.
if (deploymentDescriptor == null && !isInUpdateMode()) {
throw new BuildException("webxml attribute is required", location);
@@ -139,8 +138,7 @@ public class War extends Jar {
}
protected void zipFile(File file, ZipOutputStream zOut, String vPath)
- throws IOException
- {
+ throws IOException {
// If the file being added is WEB-INF/web.xml, we warn if it's
// not the one specified in the "webxml" attribute - or if
// it's being added twice, meaning the same file is specified
diff --git a/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java b/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java
index c756b60e0..bbeea0672 100644
--- a/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java
+++ b/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java
@@ -454,8 +454,7 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger {
configureLiaison(stylesheet);
liaison.transform(inFile, outFile);
}
- }
- catch (Exception ex) {
+ } catch (Exception ex) {
// If failed to process document, must delete target document,
// or it will not attempt to process it the second time
log("Failed to process " + inFile, Project.MSG_INFO);
diff --git a/src/main/org/apache/tools/ant/taskdefs/Zip.java b/src/main/org/apache/tools/ant/taskdefs/Zip.java
index d78d8b18a..fe8d5a749 100644
--- a/src/main/org/apache/tools/ant/taskdefs/Zip.java
+++ b/src/main/org/apache/tools/ant/taskdefs/Zip.java
@@ -282,22 +282,18 @@ public class Zip extends MatchingTask {
addingNewFiles = true;
doUpdate = doUpdate && zipFile.exists();
- if (doUpdate)
- {
+ if (doUpdate) {
FileUtils fileUtils = FileUtils.newFileUtils();
renamedFile =
fileUtils.createTempFile("zip", ".tmp",
fileUtils.getParentFile(zipFile));
- try
- {
+ try {
if (!zipFile.renameTo(renamedFile)) {
throw new BuildException("Unable to rename old file to "
+ "temporary file");
}
- }
- catch (SecurityException e)
- {
+ } catch (SecurityException e) {
throw new BuildException("Not allowed to rename old file to "
+ "temporary file");
}
@@ -369,8 +365,7 @@ public class Zip extends MatchingTask {
ZipFileSet oldFiles = new ZipFileSet();
oldFiles.setSrc(renamedFile);
- for (int i = 0; i < addedFiles.size(); i++)
- {
+ for (int i = 0; i < addedFiles.size(); i++) {
PatternSet.NameEntry ne = oldFiles.createExclude();
ne.setName((String) addedFiles.elementAt(i));
}
@@ -485,14 +480,11 @@ public class Zip extends MatchingTask {
}
for (int i = 0; i < files.length; i++) {
File f = new File(thisBaseDir, files[i]);
- if (fullpath.length() > 0)
- {
+ if (fullpath.length() > 0) {
// Add this file at the specified location.
addParentDirs(null, fullpath, zOut, "");
zipFile(f, zOut, fullpath);
- }
- else
- {
+ } else {
// Add this file with the specified prefix.
String name = files[i].replace(File.separatorChar, '/');
addParentDirs(thisBaseDir, name, zOut, prefix);
@@ -504,8 +496,7 @@ public class Zip extends MatchingTask {
protected void addZipEntries(ZipFileSet fs, DirectoryScanner ds,
ZipOutputStream zOut, String prefix,
String fullpath)
- throws IOException
- {
+ throws IOException {
log("adding zip entries: " + fullpath, Project.MSG_VERBOSE);
if (prefix.length() > 0 && fullpath.length() > 0) {
@@ -546,13 +537,11 @@ public class Zip extends MatchingTask {
}
protected void initZipOutputStream(ZipOutputStream zOut)
- throws IOException, BuildException
- {
+ throws IOException, BuildException {
}
protected void finalizeZipOutputStream(ZipOutputStream zOut)
- throws IOException, BuildException
- {
+ throws IOException, BuildException {
}
/**
@@ -603,8 +592,7 @@ public class Zip extends MatchingTask {
* @exception BuildException if it likes
*/
protected boolean isUpToDate(FileScanner[] scanners, File zipFile)
- throws BuildException
- {
+ throws BuildException {
String[][] fileNames = grabFileNames(scanners);
File[] files = grabFiles(scanners, fileNames);
if (files.length == 0) {
@@ -676,8 +664,7 @@ public class Zip extends MatchingTask {
}
protected void zipDir(File dir, ZipOutputStream zOut, String vPath)
- throws IOException
- {
+ throws IOException {
if (addedDirs.get(vPath) != null) {
// don't add directories we've already added.
// no warning if we try, it is harmless in and of itself
@@ -706,30 +693,22 @@ public class Zip extends MatchingTask {
protected void zipFile(InputStream in, ZipOutputStream zOut, String vPath,
long lastModified, File file)
- throws IOException
- {
+ throws IOException {
if (entries.contains(vPath)) {
- if (duplicate.equals("preserve"))
- {
+ if (duplicate.equals("preserve")) {
log(vPath + " already added, skipping", Project.MSG_INFO);
return;
- }
- else if (duplicate.equals("fail"))
- {
+ } else if (duplicate.equals("fail")) {
throw new BuildException("Duplicate file " + vPath
+ " was found and the duplicate "
+ "attribute is 'fail'.");
- }
- else
- {
+ } else {
// duplicate equal to add, so we continue
log("duplicate file " + vPath
+ " found, adding.", Project.MSG_VERBOSE);
}
- }
- else
- {
+ } else {
log("adding entry " + vPath, Project.MSG_VERBOSE);
}
@@ -794,8 +773,7 @@ public class Zip extends MatchingTask {
}
protected void zipFile(File file, ZipOutputStream zOut, String vPath)
- throws IOException
- {
+ throws IOException {
if (file.equals(zipFile)) {
throw new BuildException("A zip file cannot include itself",
location);
diff --git a/src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapterFactory.java b/src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapterFactory.java
index 0708b500c..47d5a082f 100644
--- a/src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapterFactory.java
+++ b/src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapterFactory.java
@@ -111,8 +111,7 @@ public class CompilerAdapterFactory {
compilerType.equalsIgnoreCase("javac1.2")) {
if (isClassicCompilerSupported) {
return new Javac12();
- }
- else {
+ } else {
throw new BuildException("This version of java does "
+ "not support the classic compiler");
}
@@ -131,8 +130,7 @@ public class CompilerAdapterFactory {
task.log("Modern compiler not found - looking for "
+ "classic compiler", Project.MSG_WARN);
return new Javac12();
- }
- else {
+ } else {
throw new BuildException("Unable to find a javac compiler;\n"
+ "com.sun.tools.javac.Main is not on the classpath.\n"
+ "Perhaps JAVA_HOME does not point to the JDK");
diff --git a/src/main/org/apache/tools/ant/taskdefs/compilers/Javac12.java b/src/main/org/apache/tools/ant/taskdefs/compilers/Javac12.java
index 285687b03..c20c74e84 100644
--- a/src/main/org/apache/tools/ant/taskdefs/compilers/Javac12.java
+++ b/src/main/org/apache/tools/ant/taskdefs/compilers/Javac12.java
@@ -100,15 +100,13 @@ public class Javac12 extends DefaultCompilerAdapter {
(Boolean) compile.invoke(compiler,
new Object[] {cmd.getArguments()});
return ok.booleanValue();
- }
- catch (ClassNotFoundException ex) {
+ } catch (ClassNotFoundException ex) {
throw new BuildException("Cannot use classic compiler, as it is "
+ "not available. A common solution is "
+ "to set the environment variable"
+ " JAVA_HOME to your jdk directory.",
location);
- }
- catch (Exception ex) {
+ } catch (Exception ex) {
if (ex instanceof BuildException) {
throw (BuildException) ex;
} else {
diff --git a/src/main/org/apache/tools/ant/taskdefs/compilers/Kjc.java b/src/main/org/apache/tools/ant/taskdefs/compilers/Kjc.java
index 9e716a718..cbecdd1a4 100644
--- a/src/main/org/apache/tools/ant/taskdefs/compilers/Kjc.java
+++ b/src/main/org/apache/tools/ant/taskdefs/compilers/Kjc.java
@@ -88,15 +88,13 @@ public class Kjc extends DefaultCompilerAdapter {
(Boolean) compile.invoke(null,
new Object[] {cmd.getArguments()});
return ok.booleanValue();
- }
- catch (ClassNotFoundException ex) {
+ } catch (ClassNotFoundException ex) {
throw new BuildException("Cannot use kjc compiler, as it is not "
+ "available. A common solution is to "
+ "set the environment variable CLASSPATH "
+ "to your kjc archive (kjc.jar).",
location);
- }
- catch (Exception ex) {
+ } catch (Exception ex) {
if (ex instanceof BuildException) {
throw (BuildException) ex;
} else {
diff --git a/src/main/org/apache/tools/ant/taskdefs/cvslib/ChangeLogParser.java b/src/main/org/apache/tools/ant/taskdefs/cvslib/ChangeLogParser.java
index bdd9576ac..55fc44ab0 100644
--- a/src/main/org/apache/tools/ant/taskdefs/cvslib/ChangeLogParser.java
+++ b/src/main/org/apache/tools/ant/taskdefs/cvslib/ChangeLogParser.java
@@ -147,14 +147,11 @@ class ChangeLogParser {
m_comment = m_comment.substring(0, end);
saveEntry();
m_status = GET_FILE;
- }
- else if (line.startsWith("----------------------------")) {
+ } else if (line.startsWith("----------------------------")) {
final int end = m_comment.length() - lineSeparator.length(); //was -1
m_comment = m_comment.substring(0, end);
m_status = GET_PREVIOUS_REV;
- }
- else
- {
+ } else {
m_comment += line + lineSeparator;
}
}
@@ -180,8 +177,7 @@ class ChangeLogParser {
if (line.startsWith("revision")) {
m_revision = line.substring(9);
m_status = GET_DATE;
- }
- else if (line.startsWith("======")) {
+ } else if (line.startsWith("======")) {
//There was no revisions in this changelog
//entry so lets move unto next file
m_status = GET_FILE;
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/EchoProperties.java b/src/main/org/apache/tools/ant/taskdefs/optional/EchoProperties.java
index 73bdf24d4..4a30626c9 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/EchoProperties.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/EchoProperties.java
@@ -275,8 +275,7 @@ public class EchoProperties extends Task {
*@param header prepend this header to the property output
*/
protected void jdk10SaveProperties(Properties props, OutputStream os,
- String header)
- {
+ String header) {
props.save(os, header);
}
}
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/Javah.java b/src/main/org/apache/tools/ant/taskdefs/optional/Javah.java
index 15173ec96..c2a50b72e 100755
--- a/src/main/org/apache/tools/ant/taskdefs/optional/Javah.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/Javah.java
@@ -321,13 +321,7 @@ public class Javah extends Task {
com.sun.tools.javah.Main main
= new com.sun.tools.javah.Main(cmd.getArguments());
main.run();
- }
- //catch (ClassNotFoundException ex) {
- // throw new BuildException("Cannot use javah because it is not available"+
- // " A common solution is to set the environment variable"+
- // " JAVA_HOME to your jdk directory.", location);
- //}
- catch (Exception ex) {
+ } catch (Exception ex) {
if (ex instanceof BuildException) {
throw (BuildException) ex;
} else {
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/PropertyFile.java b/src/main/org/apache/tools/ant/taskdefs/optional/PropertyFile.java
index 6abe159be..95a26f179 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/PropertyFile.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/PropertyFile.java
@@ -146,8 +146,7 @@ import java.text.DecimalFormat;
* @author Jeremy Mawson jem@loftinspace.com.au
* @author Erik Hatcher ehatcher@apache.org
*/
-public class PropertyFile extends Task
-{
+public class PropertyFile extends Task {
/* ========================================================================
*
@@ -180,38 +179,31 @@ public class PropertyFile extends Task
* Methods
*/
- public void execute() throws BuildException
- {
+ public void execute() throws BuildException {
checkParameters();
readFile();
executeOperation();
writeFile();
}
- public Entry createEntry()
- {
+ public Entry createEntry() {
Entry e = new Entry();
entries.addElement(e);
return e;
}
- private void executeOperation() throws BuildException
- {
- for (Enumeration e = entries.elements(); e.hasMoreElements();)
- {
+ private void executeOperation() throws BuildException {
+ for (Enumeration e = entries.elements(); e.hasMoreElements();) {
Entry entry = (Entry) e.nextElement();
entry.executeOn(properties);
}
}
- private void readFile() throws BuildException
- {
+ private void readFile() throws BuildException {
// Create the PropertyFile
properties = new Properties();
- try
- {
- if (propertyfile.exists())
- {
+ try {
+ if (propertyfile.exists()) {
log("Updating property file: "
+ propertyfile.getAbsolutePath());
FileInputStream fis = null;
@@ -224,9 +216,7 @@ public class PropertyFile extends Task
fis.close();
}
}
- }
- else
- {
+ } else {
log("Creating new property file: "
+ propertyfile.getAbsolutePath());
FileOutputStream out = null;
@@ -244,29 +234,23 @@ public class PropertyFile extends Task
}
}
- private void checkParameters() throws BuildException
- {
- if (!checkParam(propertyfile))
- {
+ private void checkParameters() throws BuildException {
+ if (!checkParam(propertyfile)) {
throw new BuildException("file token must not be null.", location);
}
}
- public void setFile(File file)
- {
+ public void setFile(File file) {
propertyfile = file;
}
- public void setComment(String hdr)
- {
+ public void setComment(String hdr) {
comment = hdr;
}
- private void writeFile() throws BuildException
- {
+ private void writeFile() throws BuildException {
BufferedOutputStream bos = null;
- try
- {
+ try {
bos = new BufferedOutputStream(new FileOutputStream(propertyfile));
// Properties.store is not available in JDK 1.1
@@ -287,8 +271,7 @@ public class PropertyFile extends Task
throw new BuildException(iae, location);
} catch (IOException ioe) {
throw new BuildException(ioe, location);
- }
- finally {
+ } finally {
if (bos != null) {
try {
bos.close();
@@ -300,13 +283,11 @@ public class PropertyFile extends Task
/*
* Returns whether the given parameter has been defined.
*/
- private boolean checkParam(String param)
- {
+ private boolean checkParam(String param) {
return !((param == null) || (param.equals("null")));
}
- private boolean checkParam(File param)
- {
+ private boolean checkParam(File param) {
return !(param == null);
}
@@ -314,8 +295,7 @@ public class PropertyFile extends Task
* Instance of this class represents nested elements of
* a task propertyfile.
*/
- public static class Entry
- {
+ public static class Entry {
private final static int DEFAULT_INT_VALUE = 0;
private final static String DEFAULT_DATE_VALUE = "now";
private final static String DEFAULT_STRING_VALUE = "";
@@ -328,28 +308,22 @@ public class PropertyFile extends Task
private String pattern = null;
private int field = Calendar.DATE;
- public void setKey(String value)
- {
+ public void setKey(String value) {
this.key = value;
}
- public void setValue(String value)
- {
+ public void setValue(String value) {
this.value = value;
}
- public void setOperation(Operation value)
- {
+ public void setOperation(Operation value) {
this.operation = Operation.toOperation(value.getValue());
}
- public void setType(Type value)
- {
+ public void setType(Type value) {
this.type = Type.toType(value.getValue());
}
- public void setDefault(String value)
- {
+ public void setDefault(String value) {
this.defaultValue = value;
}
- public void setPattern(String value)
- {
+ public void setPattern(String value) {
this.pattern = value;
}
@@ -360,27 +334,19 @@ public class PropertyFile extends Task
field = unit.getCalendarField();
}
- protected void executeOn(Properties props) throws BuildException
- {
+ protected void executeOn(Properties props) throws BuildException {
checkParameters();
// type may be null because it wasn't set
String oldValue = (String) props.get(key);
try {
- if (type == Type.INTEGER_TYPE)
- {
+ if (type == Type.INTEGER_TYPE) {
executeInteger(oldValue);
- }
- else if (type == Type.DATE_TYPE)
- {
+ } else if (type == Type.DATE_TYPE) {
executeDate(oldValue);
- }
- else if (type == Type.STRING_TYPE)
- {
+ } else if (type == Type.STRING_TYPE) {
executeString(oldValue);
- }
- else
- {
+ } else {
throw new BuildException("Unknown operation type: "
+ type);
}
@@ -405,8 +371,7 @@ public class PropertyFile extends Task
* null
if the key
was
* not contained in the property file.
*/
- private void executeDate(String oldValue) throws BuildException
- {
+ private void executeDate(String oldValue) throws BuildException {
Calendar currentValue = Calendar.getInstance();
if (pattern == null) {
@@ -421,12 +386,12 @@ public class PropertyFile extends Task
if ("now".equals(currentStringValue)) {
currentValue.setTime(new Date());
- }
- else {
+ } else {
try {
currentValue.setTime(fmt.parse(currentStringValue));
+ } catch (ParseException pe) {
+ // swallow
}
- catch (ParseException pe) { /* swollow */ }
}
if (operation != Operation.EQUALS_OPER) {
@@ -436,8 +401,7 @@ public class PropertyFile extends Task
if (operation == Operation.DECREMENT_OPER) {
offset = -1 * offset;
}
- }
- catch (NumberFormatException e) {
+ } catch (NumberFormatException e) {
throw new BuildException("Value not an integer on " + key);
}
currentValue.add(field, offset);
@@ -454,8 +418,7 @@ public class PropertyFile extends Task
* null
if the key
was
* not contained in the property file.
*/
- private void executeInteger(String oldValue) throws BuildException
- {
+ private void executeInteger(String oldValue) throws BuildException {
int currentValue = DEFAULT_INT_VALUE;
int newValue = DEFAULT_INT_VALUE;
@@ -464,25 +427,27 @@ public class PropertyFile extends Task
: new DecimalFormat();
try {
currentValue = fmt.parse(getCurrentValue(oldValue)).intValue();
+ } catch (NumberFormatException nfe) {
+ // swallow
+ } catch (ParseException pe) {
+ // swallow
}
- catch (NumberFormatException nfe) { /* swollow */ }
- catch (ParseException pe) { /* swollow */ }
if (operation == Operation.EQUALS_OPER) {
newValue = currentValue;
- }
- else {
+ } else {
int operationValue = 1;
try {
operationValue = fmt.parse(value).intValue();
+ } catch (NumberFormatException nfe) {
+ // swallow
+ } catch (ParseException pe) {
+ // swallow
}
- catch (NumberFormatException nfe) { /* swollow */ }
- catch (ParseException pe) { /* swollow */ }
if (operation == Operation.INCREMENT_OPER) {
newValue = currentValue + operationValue;
- }
- else if (operation == Operation.DECREMENT_OPER) {
+ } else if (operation == Operation.DECREMENT_OPER) {
newValue = currentValue - operationValue;
}
}
@@ -497,8 +462,7 @@ public class PropertyFile extends Task
* null
if the key
was
* not contained in the property file.
*/
- private void executeString(String oldValue) throws BuildException
- {
+ private void executeString(String oldValue) throws BuildException {
String newValue = DEFAULT_STRING_VALUE;
String currentValue = getCurrentValue(oldValue);
@@ -509,8 +473,7 @@ public class PropertyFile extends Task
if (operation == Operation.EQUALS_OPER) {
newValue = currentValue;
- }
- else if (operation == Operation.INCREMENT_OPER) {
+ } else if (operation == Operation.INCREMENT_OPER) {
newValue = currentValue + value;
}
value = newValue;
@@ -524,17 +487,20 @@ public class PropertyFile extends Task
private void checkParameters() throws BuildException {
if (type == Type.STRING_TYPE &&
operation == Operation.DECREMENT_OPER) {
- throw new BuildException("- is not suported for string properties (key:" + key + ")");
+ throw new BuildException("- is not suported for string "
+ + "properties (key:" + key + ")");
}
if (value == null && defaultValue == null) {
- throw new BuildException("value and/or default must be specified (key:" + key + ")");
+ throw new BuildException("value and/or default must be "
+ + "specified (key:" + key + ")");
}
if (key == null) {
throw new BuildException("key is mandatory");
}
if (type == Type.STRING_TYPE &&
pattern != null) {
- throw new BuildException("pattern is not suported for string properties (key:" + key + ")");
+ throw new BuildException("pattern is not suported for string "
+ + "properties (key:" + key + ")");
}
}
@@ -572,8 +538,7 @@ public class PropertyFile extends Task
if (value != null && defaultValue != null && oldValue == null) {
ret = defaultValue;
}
- }
- else {
+ } else {
ret = (oldValue == null) ? defaultValue : oldValue;
}
@@ -597,8 +562,7 @@ public class PropertyFile extends Task
public static int toOperation(String oper) {
if ("+".equals(oper)) {
return INCREMENT_OPER;
- }
- else if ("-".equals(oper)) {
+ } else if ("-".equals(oper)) {
return DECREMENT_OPER;
}
return EQUALS_OPER;
@@ -622,8 +586,7 @@ public class PropertyFile extends Task
public static int toType(String type) {
if ("int".equals(type)) {
return INTEGER_TYPE;
- }
- else if ("date".equals(type)) {
+ } else if ("date".equals(type)) {
return DATE_TYPE;
}
return STRING_TYPE;
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/Rpm.java b/src/main/org/apache/tools/ant/taskdefs/optional/Rpm.java
index 6e541dcbe..433f228b1 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/Rpm.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/Rpm.java
@@ -145,16 +145,14 @@ public class Rpm extends Task {
if (error == null && output == null) {
streamhandler = new LogStreamHandler(this, Project.MSG_INFO,
Project.MSG_WARN);
- }
- else {
+ } else {
if (output != null) {
try {
outputstream = new PrintStream(new BufferedOutputStream(new FileOutputStream(output)));
} catch (IOException e) {
throw new BuildException(e, location);
}
- }
- else {
+ } else {
outputstream = new LogOutputStream(this, Project.MSG_INFO);
}
if (error != null) {
@@ -163,8 +161,7 @@ public class Rpm extends Task {
} catch (IOException e) {
throw new BuildException(e, location);
}
- }
- else {
+ } else {
errorstream = new LogOutputStream(this, Project.MSG_WARN);
}
streamhandler = new PumpStreamHandler(outputstream, errorstream);
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/XMLValidateTask.java b/src/main/org/apache/tools/ant/taskdefs/optional/XMLValidateTask.java
index 5bc788a75..92c50fd3f 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/XMLValidateTask.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/XMLValidateTask.java
@@ -254,8 +254,7 @@ public class XMLValidateTask extends Task {
if (file.exists() && file.canRead() && file.isFile()) {
doValidate(file);
fileProcessed++;
- }
- else {
+ } else {
String errorMsg = "File " + file + " cannot be read";
if (failOnError) {
throw new BuildException(errorMsg);
@@ -479,8 +478,7 @@ public class XMLValidateTask extends Task {
}
private class LocalResolver
- implements EntityResolver
- {
+ implements EntityResolver {
private Hashtable fileDTDs = new Hashtable();
private Hashtable resourceDTDs = new Hashtable();
private Hashtable urlDTDs = new Hashtable();
@@ -521,8 +519,7 @@ public class XMLValidateTask extends Task {
}
public InputSource resolveEntity(String publicId, String systemId)
- throws SAXException
- {
+ throws SAXException {
File dtdFile = (File) fileDTDs.get(publicId);
if (dtdFile != null) {
try {
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ccm/CCMCreateTask.java b/src/main/org/apache/tools/ant/taskdefs/optional/ccm/CCMCreateTask.java
index ee94c47d0..97d6f04b3 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/ccm/CCMCreateTask.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/ccm/CCMCreateTask.java
@@ -350,8 +350,7 @@ public class CCMCreateTask extends Continuus implements ExecuteStreamHandler {
log("error procession stream , null pointer exception", Project.MSG_ERR);
npe.printStackTrace();
throw new BuildException(npe.getClass().getName());
- } // end of catch
- catch (Exception e) {
+ } catch (Exception e) {
log("error procession stream " + e.getMessage(), Project.MSG_ERR);
throw new BuildException(e.getMessage());
} // end of try-catch
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/clearcase/ClearCase.java b/src/main/org/apache/tools/ant/taskdefs/optional/clearcase/ClearCase.java
index af11bcaa6..00665ae11 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/clearcase/ClearCase.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/clearcase/ClearCase.java
@@ -133,8 +133,7 @@ public abstract class ClearCase extends Task {
exe.setWorkingDirectory(aProj.getBaseDir());
exe.setCommandline(cmd.getCommandline());
return exe.execute();
- }
- catch (java.io.IOException e) {
+ } catch (java.io.IOException e) {
throw new BuildException(e, location);
}
}
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/BorlandDeploymentTool.java b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/BorlandDeploymentTool.java
index b80fc9623..c32c6dc8f 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/BorlandDeploymentTool.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/BorlandDeploymentTool.java
@@ -231,8 +231,7 @@ public class BorlandDeploymentTool extends GenericDeploymentTool implements Exe
if (borlandDD.exists()) {
log("Borland specific file found " + borlandDD, Project.MSG_VERBOSE);
ejbFiles.put(META_DIR + BAS_DD, borlandDD);
- }
- else {
+ } else {
log("Unable to locate borland deployment descriptor. It was expected to be in " +
borlandDD.getPath(), Project.MSG_WARN);
return;
@@ -265,8 +264,7 @@ public class BorlandDeploymentTool extends GenericDeploymentTool implements Exe
Commandline.Argument arguments = javaTask.createArg();
arguments.setLine(args);
Path classpath = getCombinedClasspath();
- if (classpath != null)
- {
+ if (classpath != null) {
javaTask.setClasspath(classpath);
javaTask.setFork(true);
}
@@ -274,8 +272,7 @@ public class BorlandDeploymentTool extends GenericDeploymentTool implements Exe
log("Calling " + VERIFY + " for " + sourceJar.toString(),
Project.MSG_VERBOSE);
javaTask.execute();
- }
- catch (Exception e) {
+ } catch (Exception e) {
//TO DO : delete the file if it is not a valid file.
String msg = "Exception while calling " + VERIFY + " Details: "
+ e.toString();
@@ -307,8 +304,7 @@ public class BorlandDeploymentTool extends GenericDeploymentTool implements Exe
}
gentask.setTaskName("generate client");
gentask.execute();
- }
- catch (Exception e) {
+ } catch (Exception e) {
//TO DO : delete the file if it is not a valid file.
String msg = "Exception while calling " + VERIFY + " Details: "
+ e.toString();
@@ -363,8 +359,7 @@ public class BorlandDeploymentTool extends GenericDeploymentTool implements Exe
+ result + ")";
throw new BuildException(msg, getTask().getLocation());
}
- }
- catch (java.io.IOException e) {
+ } catch (java.io.IOException e) {
log("java2iiop exception :" + e.getMessage(), Project.MSG_ERR);
throw new BuildException(e, getTask().getLocation());
}
@@ -439,8 +434,7 @@ public class BorlandDeploymentTool extends GenericDeploymentTool implements Exe
* @param is
* @exception java.io.IOException
*/
- public void setProcessOutputStream(InputStream is) throws IOException
- {
+ public void setProcessOutputStream(InputStream is) throws IOException {
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(is));
String javafile;
@@ -455,8 +449,7 @@ public class BorlandDeploymentTool extends GenericDeploymentTool implements Exe
} // end of if ()
} // end of while ()
reader.close();
- }
- catch (Exception e) {
+ } catch (Exception e) {
String msg = "Exception while parsing java2iiop output. Details: " + e.toString();
throw new BuildException(msg, e);
}
@@ -466,8 +459,7 @@ public class BorlandDeploymentTool extends GenericDeploymentTool implements Exe
* @param param1
* @exception java.io.IOException
*/
- public void setProcessErrorStream(InputStream is) throws IOException
- {
+ public void setProcessErrorStream(InputStream is) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(is));
String s = reader.readLine();
if (s != null) {
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/BorlandGenerateClient.java b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/BorlandGenerateClient.java
index 265e4dcbf..ed765cc37 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/BorlandGenerateClient.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/BorlandGenerateClient.java
@@ -80,8 +80,7 @@ import org.apache.tools.ant.types.Reference;
*
* @ant.task name="blgenclient" category="ejb"
*/
-public class BorlandGenerateClient extends Task
-{
+public class BorlandGenerateClient extends Task {
final static String JAVA_MODE = "java";
final static String FORK_MODE = "fork";
@@ -118,8 +117,7 @@ public class BorlandGenerateClient extends Task
public void setClasspath(Path classpath) {
if (this.classpath == null) {
this.classpath = classpath;
- }
- else {
+ } else {
this.classpath.append(classpath);
}
}
@@ -167,8 +165,7 @@ public class BorlandGenerateClient extends Task
if (mode.equalsIgnoreCase(FORK_MODE)) {
executeFork();
- } // end of if ()
- else {
+ } else {
executeJava();
} // end of else
}
@@ -207,8 +204,7 @@ public class BorlandGenerateClient extends Task
log("Calling EJBUtilities", Project.MSG_VERBOSE);
execTask.execute();
- }
- catch (Exception e) {
+ } catch (Exception e) {
// Have to catch this because of the semantics of calling main()
String msg = "Exception while calling generateclient Details: " + e.toString();
throw new BuildException(msg, e);
@@ -242,8 +238,7 @@ public class BorlandGenerateClient extends Task
log("Calling java2iiop", Project.MSG_VERBOSE);
execTask.execute();
- }
- catch (Exception e) {
+ } catch (Exception e) {
// Have to catch this because of the semantics of calling main()
String msg = "Exception while calling generateclient Details: "
+ e.toString();
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/DDCreatorHelper.java b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/DDCreatorHelper.java
index 785274ce4..59f08b715 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/DDCreatorHelper.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/DDCreatorHelper.java
@@ -125,8 +125,7 @@ public class DDCreatorHelper {
String serName = null;
if (extIndex != -1) {
serName = descriptorName.substring(0, extIndex) + ".ser";
- }
- else {
+ } else {
serName = descriptorName + ".ser";
}
File serFile = new File(generatedFilesDirectory, serName);
@@ -141,8 +140,7 @@ public class DDCreatorHelper {
descriptorFile.getPath()};
try {
weblogic.ejb.utils.DDCreator.main(args);
- }
- catch (Exception e) {
+ } catch (Exception e) {
// there was an exception - run with no exit to get proper error
String[] newArgs = {"-d", generatedFilesDirectory.getPath(),
"-outputfile", serFile.getName(),
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/DescriptorHandler.java b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/DescriptorHandler.java
index 6905fb603..cbd312f8d 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/DescriptorHandler.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/DescriptorHandler.java
@@ -188,8 +188,7 @@ public class DescriptorHandler extends org.xml.sax.HandlerBase {
}
public InputSource resolveEntity(String publicId, String systemId)
- throws SAXException
- {
+ throws SAXException {
this.publicId = publicId;
File dtdFile = (File) fileDTDs.get(publicId);
@@ -273,20 +272,15 @@ public class DescriptorHandler extends org.xml.sax.HandlerBase {
currentText = "";
if (name.equals(EJB_REF)) {
inEJBRef = true;
- }
- else if (parseState == STATE_LOOKING_EJBJAR && name.equals(EJB_JAR)) {
+ } else if (parseState == STATE_LOOKING_EJBJAR && name.equals(EJB_JAR)) {
parseState = STATE_IN_EJBJAR;
- }
- else if (parseState == STATE_IN_EJBJAR && name.equals(ENTERPRISE_BEANS)) {
+ } else if (parseState == STATE_IN_EJBJAR && name.equals(ENTERPRISE_BEANS)) {
parseState = STATE_IN_BEANS;
- }
- else if (parseState == STATE_IN_BEANS && name.equals(SESSION_BEAN)) {
+ } else if (parseState == STATE_IN_BEANS && name.equals(SESSION_BEAN)) {
parseState = STATE_IN_SESSION;
- }
- else if (parseState == STATE_IN_BEANS && name.equals(ENTITY_BEAN)) {
+ } else if (parseState == STATE_IN_BEANS && name.equals(ENTITY_BEAN)) {
parseState = STATE_IN_ENTITY;
- }
- else if (parseState == STATE_IN_BEANS && name.equals(MESSAGE_BEAN)) {
+ } else if (parseState == STATE_IN_BEANS && name.equals(MESSAGE_BEAN)) {
parseState = STATE_IN_MESSAGE;
}
}
@@ -307,20 +301,15 @@ public class DescriptorHandler extends org.xml.sax.HandlerBase {
this.currentElement = "";
if (name.equals(EJB_REF)) {
inEJBRef = false;
- }
- else if (parseState == STATE_IN_ENTITY && name.equals(ENTITY_BEAN)) {
+ } else if (parseState == STATE_IN_ENTITY && name.equals(ENTITY_BEAN)) {
parseState = STATE_IN_BEANS;
- }
- else if (parseState == STATE_IN_SESSION && name.equals(SESSION_BEAN)) {
+ } else if (parseState == STATE_IN_SESSION && name.equals(SESSION_BEAN)) {
parseState = STATE_IN_BEANS;
- }
- else if (parseState == STATE_IN_MESSAGE && name.equals(MESSAGE_BEAN)) {
+ } else if (parseState == STATE_IN_MESSAGE && name.equals(MESSAGE_BEAN)) {
parseState = STATE_IN_BEANS;
- }
- else if (parseState == STATE_IN_BEANS && name.equals(ENTERPRISE_BEANS)) {
+ } else if (parseState == STATE_IN_BEANS && name.equals(ENTERPRISE_BEANS)) {
parseState = STATE_IN_EJBJAR;
- }
- else if (parseState == STATE_IN_EJBJAR && name.equals(EJB_JAR)) {
+ } else if (parseState == STATE_IN_EJBJAR && name.equals(EJB_JAR)) {
parseState = STATE_LOOKING_EJBJAR;
}
}
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/EjbcHelper.java b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/EjbcHelper.java
index 6ebac9371..15a5c2d2b 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/EjbcHelper.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/EjbcHelper.java
@@ -229,13 +229,11 @@ public class EjbcHelper {
primaryKeyClassSource.lastModified() > classModificationTime) {
return true;
}
- }
- catch (Throwable descriptorLoadException) {
+ } catch (Throwable descriptorLoadException) {
System.out.println("Exception occurred reading " + descriptorFile.getName() + " - continuing");
// any problems - just regenerate
return true;
- }
- finally {
+ } finally {
if (fis != null) {
fis.close();
}
@@ -257,8 +255,7 @@ public class EjbcHelper {
if (isRegenRequired(descriptorFile)) {
System.out.println("Running ejbc for " + descriptorFile.getName());
regenerateSupportClasses(descriptorFile);
- }
- else {
+ } else {
System.out.println(descriptorFile.getName() + " is up to date");
}
manifest += "Name: " + descriptorName.replace('\\', '/') + "\nEnterprise-Bean: True\n\n";
@@ -285,8 +282,7 @@ public class EjbcHelper {
try {
weblogic.ejbc.main(args);
- }
- catch (Exception e) {
+ } catch (Exception e) {
// run with no exit for better reporting
String[] newArgs = getCommandLine(true, descriptorFile);
weblogic.ejbc.main(newArgs);
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetEjbc.java b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetEjbc.java
index a9bb01535..8436d8d21 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetEjbc.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetEjbc.java
@@ -1208,8 +1208,7 @@ public class IPlanetEjbc {
return -1;
}
latestModified = Math.max(latestModified, modified);
- }
- else {
+ } else {
pkFile = null;
}
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetEjbcTask.java b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetEjbcTask.java
index 06527211f..247094be4 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetEjbcTask.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetEjbcTask.java
@@ -293,8 +293,7 @@ public class IPlanetEjbcTask extends Task {
} catch (SAXException e) {
String msg = "Unable to create a SAXParser: " + e.getMessage();
throw new BuildException(msg, e, location);
- }
- catch (ParserConfigurationException e) {
+ } catch (ParserConfigurationException e) {
String msg = "Unable to create a SAXParser: " + e.getMessage();
throw new BuildException(msg, e, location);
}
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicTOPLinkDeploymentTool.java b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicTOPLinkDeploymentTool.java
index c81759bcc..a6e3ff449 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicTOPLinkDeploymentTool.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicTOPLinkDeploymentTool.java
@@ -114,8 +114,7 @@ public class WeblogicTOPLinkDeploymentTool extends WeblogicDeploymentTool {
if (toplinkDD.exists()) {
ejbFiles.put(META_DIR + toplinkDescriptor,
toplinkDD);
- }
- else {
+ } else {
log("Unable to locate toplink deployment descriptor. It was expected to be in " +
toplinkDD.getPath(), Project.MSG_WARN);
}
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJAntTool.java b/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJAntTool.java
index 174dd84cc..3f1c7e223 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJAntTool.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJAntTool.java
@@ -117,8 +117,7 @@ public class VAJAntTool {
if (args.length >= 2 && args[1] instanceof String) {
String projectName = (String) args[1];
info = loadBuildData(projectName);
- }
- else {
+ } else {
info = new VAJBuildInfo();
}
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJAntToolGUI.java b/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJAntToolGUI.java
index 53c08c738..b8edd35d6 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJAntToolGUI.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJAntToolGUI.java
@@ -209,8 +209,7 @@ public class VAJAntToolGUI extends Frame {
if (error == null) {
getMessageTextArea().append(lineSeparator + "BUILD SUCCESSFUL");
- }
- else {
+ } else {
logException(error);
}
@@ -232,8 +231,7 @@ public class VAJAntToolGUI extends Frame {
if (nested != null) {
nested.printStackTrace(System.err);
}
- }
- else {
+ } else {
error.printStackTrace(System.err);
}
}
@@ -339,8 +337,7 @@ public class VAJAntToolGUI extends Frame {
try {
getBuildInfo().updateTargetList();
fillList();
- }
- catch (Throwable fileNotFound) {
+ } catch (Throwable fileNotFound) {
handleException(fileNotFound);
getTargetList().removeAll();
getBuildButton().setEnabled(false);
@@ -370,8 +367,7 @@ public class VAJAntToolGUI extends Frame {
if (e.getSource() == VAJAntToolGUI.this.getMessageOkButton()) {
getMessageFrame().dispose();
}
- }
- catch (Throwable exc) {
+ } catch (Throwable exc) {
handleException(exc);
}
}
@@ -390,8 +386,7 @@ public class VAJAntToolGUI extends Frame {
if (e.getSource() == VAJAntToolGUI.this.getTargetList()) {
getBuildInfo().setTarget(getTargetList().getSelectedItem());
}
- }
- catch (Throwable exc) {
+ } catch (Throwable exc) {
handleException(exc);
}
}
@@ -432,8 +427,7 @@ public class VAJAntToolGUI extends Frame {
if (e.getSource() == VAJAntToolGUI.this.getMessageFrame()) {
getMessageFrame().dispose();
}
- }
- catch (Throwable exc) {
+ } catch (Throwable exc) {
handleException(exc);
}
}
@@ -524,8 +518,7 @@ public class VAJAntToolGUI extends Frame {
try {
getMessageFrame().show();
getBuildInfo().executeProject(logger);
- }
- catch (Throwable exc) {
+ } catch (Throwable exc) {
logger.logException(exc);
}
return;
@@ -1346,8 +1339,7 @@ public class VAJAntToolGUI extends Frame {
private void saveBuildInfo() {
try {
VAJAntTool.saveBuildData(getBuildInfo());
- }
- catch (Throwable exc) {
+ } catch (Throwable exc) {
// This Exception occurs when you try to write into a versioned project
handleException(exc);
}
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJLocalUtil.java b/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJLocalUtil.java
index 1afa09eb2..1668ab9c9 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJLocalUtil.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJLocalUtil.java
@@ -350,8 +350,7 @@ abstract class VAJLocalUtil implements VAJUtil{
Type[] importedTypes = getWorkspace().importData(importSpec);
if (importedTypes == null) {
throw new BuildException("Unable to import into Workspace!");
- }
- else {
+ } else {
log(importedTypes.length + " types imported", MSG_DEBUG);
for (int i = 0; i < importedTypes.length; i++) {
log(importedTypes[i].getPackage().getName()
@@ -428,11 +427,9 @@ abstract class VAJLocalUtil implements VAJUtil{
* @param fileType type of files (Source/Class/Resource)
* @param summaryLog buffer for logging
*/
- private void addFilesToImport(
- ImportCodeSpec spec, boolean doImport,
+ private void addFilesToImport(ImportCodeSpec spec, boolean doImport,
Vector files, String fileType,
- StringBuffer summaryLog)
- {
+ StringBuffer summaryLog) {
if (doImport) {
String[] fileArr = new String[files.size()];
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/AbstractHotDeploymentTool.java b/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/AbstractHotDeploymentTool.java
index 4b57fe1b7..817bcfb2a 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/AbstractHotDeploymentTool.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/AbstractHotDeploymentTool.java
@@ -80,8 +80,7 @@ import org.apache.tools.ant.types.Path;
* @see org.apache.tools.ant.taskdefs.optional.j2ee.HotDeploymentTool
* @see org.apache.tools.ant.taskdefs.optional.j2ee.ServerDeploy
*/
-public abstract class AbstractHotDeploymentTool implements HotDeploymentTool
-{
+public abstract class AbstractHotDeploymentTool implements HotDeploymentTool {
/** The parent task **/
private ServerDeploy task;
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/GenericHotDeploymentTool.java b/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/GenericHotDeploymentTool.java
index 514828d17..974cdb659 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/GenericHotDeploymentTool.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/GenericHotDeploymentTool.java
@@ -69,8 +69,7 @@ import org.apache.tools.ant.taskdefs.Java;
* @see org.apache.tools.ant.taskdefs.optional.j2ee.AbstractHotDeploymentTool
* @see org.apache.tools.ant.taskdefs.optional.j2ee.ServerDeploy
*/
-public class GenericHotDeploymentTool extends AbstractHotDeploymentTool
-{
+public class GenericHotDeploymentTool extends AbstractHotDeploymentTool {
/** A Java task used to run the deployment tool **/
private Java java;
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/HotDeploymentTool.java b/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/HotDeploymentTool.java
index 383a68195..c961d98b0 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/HotDeploymentTool.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/HotDeploymentTool.java
@@ -63,8 +63,7 @@ import org.apache.tools.ant.BuildException;
* @see org.apache.tools.ant.taskdefs.optional.j2ee.AbstractHotDeploymentTool
* @see org.apache.tools.ant.taskdefs.optional.j2ee.ServerDeploy
*/
-public interface HotDeploymentTool
-{
+public interface HotDeploymentTool {
/** The delete action String **/
public static final String ACTION_DELETE = "delete";
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/JonasHotDeploymentTool.java b/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/JonasHotDeploymentTool.java
index b5f26a399..38e566ca5 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/JonasHotDeploymentTool.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/JonasHotDeploymentTool.java
@@ -241,11 +241,9 @@ public class JonasHotDeploymentTool extends GenericHotDeploymentTool implements
action.equals(ACTION_UPDATE) ||
action.equals("redeploy")) {
java.createArg().setLine("-a " + getTask().getSource());
- }
- else if (action.equals(ACTION_DELETE) || action.equals(ACTION_UNDEPLOY)) {
+ } else if (action.equals(ACTION_DELETE) || action.equals(ACTION_UNDEPLOY)) {
java.createArg().setLine("-r " + getTask().getSource());
- }
- else if (action.equals(ACTION_LIST)) {
+ } else if (action.equals(ACTION_LIST)) {
java.createArg().setValue("-l");
}
}
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/ServerDeploy.java b/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/ServerDeploy.java
index 5d99a21c3..dae14f7a9 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/ServerDeploy.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/ServerDeploy.java
@@ -74,8 +74,7 @@ import org.apache.tools.ant.Task;
* @see org.apache.tools.ant.taskdefs.optional.j2ee.GenericHotDeploymentTool
* @see org.apache.tools.ant.taskdefs.optional.j2ee.WebLogicHotDeploymentTool
*/
-public class ServerDeploy extends Task
-{
+public class ServerDeploy extends Task {
/** The action to be performed. IE: "deploy", "delete", etc... **/
private String action;
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/WebLogicHotDeploymentTool.java b/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/WebLogicHotDeploymentTool.java
index ba4423203..95b398b9f 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/WebLogicHotDeploymentTool.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/WebLogicHotDeploymentTool.java
@@ -96,8 +96,7 @@ public class WebLogicHotDeploymentTool extends AbstractHotDeploymentTool impleme
* tools is executed.
* @exception org.apache.tools.ant.BuildException if the attributes are invalid or incomplete.
*/
- public void deploy()
- {
+ public void deploy() {
Java java = (Java) getTask().getProject().createTask("java");
java.setFork(true);
java.setFailonerror(true);
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JJTree.java b/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JJTree.java
index 17d20b399..e8488246d 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JJTree.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JJTree.java
@@ -219,8 +219,7 @@ public class JJTree extends Task {
if (process.execute() != 0) {
throw new BuildException("JJTree failed.");
}
- }
- catch (IOException e) {
+ } catch (IOException e) {
throw new BuildException("Failed to launch JJTree", e);
}
}
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JavaCC.java b/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JavaCC.java
index 29dee70c4..2c363a955 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JavaCC.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JavaCC.java
@@ -224,8 +224,7 @@ public class JavaCC extends Task {
// use the directory containing the target as the output directory
if (outputDirectory == null) {
outputDirectory = new File(target.getParent());
- }
- else if (!outputDirectory.isDirectory()) {
+ } else if (!outputDirectory.isDirectory()) {
throw new BuildException("Outputdir not a directory.");
}
cmdl.createArgument().setValue("-OUTPUT_DIRECTORY:"
@@ -281,8 +280,7 @@ public class JavaCC extends Task {
* file.
*
*/
- private File getOutputJavaFile(File outputdir, File srcfile)
- {
+ private File getOutputJavaFile(File outputdir, File srcfile) {
String path = srcfile.getPath();
// Extract file's base-name
@@ -295,8 +293,7 @@ public class JavaCC extends Task {
int startExtn = path.lastIndexOf('.');
if (startExtn != -1) {
path = path.substring(0, startExtn) + ".java";
- }
- else {
+ } else {
path += ".java";
}
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTask.java b/src/main/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTask.java
index 38e3f8fc4..2ad065229 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTask.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTask.java
@@ -228,17 +228,14 @@ public class JDependTask extends Task {
}
- public void setFormat(FormatAttribute ea)
- {
+ public void setFormat(FormatAttribute ea) {
format = ea.getValue();
}
- public static class FormatAttribute extends EnumeratedAttribute
- {
+ public static class FormatAttribute extends EnumeratedAttribute {
private String [] formats = new String[]{"xml", "text"};
- public String[] getValues()
- {
+ public String[] getValues() {
return formats;
}
}
@@ -324,8 +321,7 @@ public class JDependTask extends Task {
FileWriter fw;
try {
fw = new FileWriter(getOutputFile().getPath());
- }
- catch (IOException e) {
+ } catch (IOException e) {
String msg = "JDepend Failed when creating the output file: "
+ e.getMessage();
log(msg);
@@ -349,8 +345,7 @@ public class JDependTask extends Task {
}
try {
jdepend.addDirectory(f.getPath());
- }
- catch (IOException e) {
+ } catch (IOException e) {
String msg = "JDepend Failed when adding a source directory: "
+ e.getMessage();
log(msg);
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/jlink/ClassNameReader.java b/src/main/org/apache/tools/ant/taskdefs/optional/jlink/ClassNameReader.java
index 71531c61d..c0e3c773d 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/jlink/ClassNameReader.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/jlink/ClassNameReader.java
@@ -86,8 +86,7 @@ class ConstantPool {
for (int i = 1; i < count; i++) {
byte type = data.readByte();
types[i] = type;
- switch (type)
- {
+ switch (type) {
case UTF8 :
values[i] = data.readUTF();
break;
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/jlink/JlinkTask.java b/src/main/org/apache/tools/ant/taskdefs/optional/jlink/JlinkTask.java
index 7299ec16f..09ad63ab2 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/jlink/JlinkTask.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/jlink/JlinkTask.java
@@ -112,8 +112,7 @@ public class JlinkTask extends MatchingTask {
public void setMergefiles(Path mergefiles) {
if (this.mergefiles == null) {
this.mergefiles = mergefiles;
- }
- else {
+ } else {
this.mergefiles.append(mergefiles);
}
}
@@ -135,8 +134,7 @@ public class JlinkTask extends MatchingTask {
public void setAddfiles(Path addfiles) {
if (this.addfiles == null) {
this.addfiles = addfiles;
- }
- else {
+ } else {
this.addfiles.append(addfiles);
}
}
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/jsp/JspC.java b/src/main/org/apache/tools/ant/taskdefs/optional/jsp/JspC.java
index 303a01920..122f44b5c 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/jsp/JspC.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/jsp/JspC.java
@@ -110,8 +110,7 @@ import org.apache.tools.ant.types.Reference;
* @author J D Glanville
* @since 1.5
*/
-public class JspC extends MatchingTask
-{
+public class JspC extends MatchingTask {
/* ------------------------------------------------------------ */
private Path classpath;
private Path src;
@@ -226,23 +225,19 @@ public class JspC extends MatchingTask
return failOnError;
}
/* ------------------------------------------------------------ */
- public String getIeplugin()
- {
+ public String getIeplugin() {
return iepluginid;
}
/** Set the ieplugin id */
- public void setIeplugin(String iepluginid_)
- {
+ public void setIeplugin(String iepluginid_) {
iepluginid = iepluginid_;
}
/* ------------------------------------------------------------ */
- public boolean isMapped()
- {
+ public boolean isMapped() {
return mapped;
}
/** set the mapped flag */
- public void setMapped(boolean mapped_)
- {
+ public void setMapped(boolean mapped_) {
mapped = mapped_;
}
@@ -338,8 +333,7 @@ public class JspC extends MatchingTask
//demand create vector of filesets
if (webApp == null) {
webApp = webappParam;
- }
- else {
+ } else {
throw new BuildException("Only one webapp can be specified");
}
}
@@ -429,12 +423,10 @@ public class JspC extends MatchingTask
+ dest);
doCompilation(compiler);
- }
- else {
+ } else {
if (filecount == 0) {
log("there were no files to compile", Project.MSG_INFO);
- }
- else {
+ } else {
log("all files are up to date", Project.MSG_VERBOSE);
}
}
@@ -468,8 +460,7 @@ public class JspC extends MatchingTask
if (!compiler.execute()) {
if (failOnError) {
throw new BuildException(FAIL_MSG, location);
- }
- else {
+ } else {
log(FAIL_MSG, Project.MSG_ERR);
}
}
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/jsp/JspNameMangler.java b/src/main/org/apache/tools/ant/taskdefs/optional/jsp/JspNameMangler.java
index 109b8400d..e1562d06a 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/jsp/JspNameMangler.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/jsp/JspNameMangler.java
@@ -121,8 +121,7 @@ public class JspNameMangler implements JspMangler {
char firstChar = className.charAt(0);
if (Character.isJavaIdentifierStart(firstChar)) {
modifiedClassName.append(firstChar);
- }
- else {
+ } else {
modifiedClassName.append(mangleChar(firstChar));
}
// this is the rest
@@ -130,8 +129,7 @@ public class JspNameMangler implements JspMangler {
char subChar = className.charAt(i);
if (Character.isJavaIdentifierPart(subChar)) {
modifiedClassName.append(subChar);
- }
- else {
+ } else {
modifiedClassName.append(mangleChar(subChar));
}
}
@@ -150,8 +148,7 @@ public class JspNameMangler implements JspMangler {
String filename = jspFile.getName();
if (filename.endsWith(".jsp")) {
className = filename.substring(0, filename.length() - 4);
- }
- else {
+ } else {
className = filename;
}
return className;
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/jsp/WLJspc.java b/src/main/org/apache/tools/ant/taskdefs/optional/jsp/WLJspc.java
index 6eac76e2c..6a44bfcb6 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/jsp/WLJspc.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/jsp/WLJspc.java
@@ -113,8 +113,7 @@ import java.util.StringTokenizer;
*
*/
-public class WLJspc extends MatchingTask
-{
+public class WLJspc extends MatchingTask {
//TODO Test on other versions of weblogic
//TODO add more attributes to the task, to take care of all jspc options
//TODO Test on Unix
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/DefaultJspCompilerAdapter.java b/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/DefaultJspCompilerAdapter.java
index 54948d5e8..514305257 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/DefaultJspCompilerAdapter.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/DefaultJspCompilerAdapter.java
@@ -83,8 +83,7 @@ public abstract class DefaultJspCompilerAdapter
*/
protected void logAndAddFilesToCompile(JspC jspc,
Vector compileList,
- Commandline cmd)
- {
+ Commandline cmd) {
jspc.log("Compilation args: " + cmd.toString(), Project.MSG_VERBOSE);
StringBuffer niceSourceList = new StringBuffer("File");
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/JasperC.java b/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/JasperC.java
index 3cf7282f8..78a233fd0 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/JasperC.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/JasperC.java
@@ -73,8 +73,7 @@ import java.io.File;
* @author steve loughran
* @since ant1.5
*/
-public class JasperC extends DefaultJspCompilerAdapter
-{
+public class JasperC extends DefaultJspCompilerAdapter {
/**
* our execute method
*/
@@ -90,8 +89,7 @@ public class JasperC extends DefaultJspCompilerAdapter
Java java = (Java) (getJspc().getProject()).createTask("java");
if (getJspc().getClasspath() != null) {
java.setClasspath(getJspc().getClasspath());
- }
- else {
+ } else {
java.setClasspath(Path.systemClasspath);
}
java.setClassname("org.apache.jasper.JspC");
@@ -105,8 +103,7 @@ public class JasperC extends DefaultJspCompilerAdapter
java.setFork(true);
java.execute();
return true;
- }
- catch (Exception ex) {
+ } catch (Exception ex) {
//@todo implement failonerror support here?
if (ex instanceof BuildException) {
throw (BuildException) ex;
@@ -114,8 +111,7 @@ public class JasperC extends DefaultJspCompilerAdapter
throw new BuildException("Error running jsp compiler: ",
ex, getJspc().getLocation());
}
- }
- finally {
+ } finally {
getJspc().deleteEmptyJavaFiles();
}
}
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLJUnitResultFormatter.java b/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLJUnitResultFormatter.java
index 717682af5..1d1256089 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLJUnitResultFormatter.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLJUnitResultFormatter.java
@@ -91,8 +91,7 @@ public class XMLJUnitResultFormatter implements JUnitResultFormatter, XMLConstan
private static DocumentBuilder getDocumentBuilder() {
try {
return DocumentBuilderFactory.newInstance().newDocumentBuilder();
- }
- catch (Exception exc) {
+ } catch (Exception exc) {
throw new ExceptionInInitializerError(exc);
}
}
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/net/MimeMail.java b/src/main/org/apache/tools/ant/taskdefs/optional/net/MimeMail.java
index 7243bef7f..17eda1514 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/net/MimeMail.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/net/MimeMail.java
@@ -69,16 +69,14 @@ import org.apache.tools.ant.taskdefs.email.EmailTask;
* @author ehatcher@apache.org Erik Hatcher
* @author paulo.gaspar@krankikom.de Paulo Gaspar
*/
-public class MimeMail extends EmailTask
-{
+public class MimeMail extends EmailTask {
/**
* Executes this build task.
*
* @exception BuildException On error.
*/
public void execute()
- throws BuildException
- {
+ throws BuildException {
log("DEPRECATED - The " + getTaskName() + " task is deprecated. "
+ "Use the mail task instead.");
super.execute();
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/net/TelnetTask.java b/src/main/org/apache/tools/ant/taskdefs/optional/net/TelnetTask.java
index eeb87453c..c702262ca 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/net/TelnetTask.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/net/TelnetTask.java
@@ -120,8 +120,7 @@ public class TelnetTask extends Task {
* Connect and possibly login
* Iterate through the list of Reads and writes
*/
- public void execute() throws BuildException
- {
+ public void execute() throws BuildException {
/** A server name is required to continue */
if (server == null) {
throw new BuildException("No Server Specified");
@@ -149,8 +148,7 @@ public class TelnetTask extends Task {
}
/** Process each sub command */
Enumeration tasksToRun = telnetTasks.elements();
- while (tasksToRun != null && tasksToRun.hasMoreElements())
- {
+ while (tasksToRun != null && tasksToRun.hasMoreElements()) {
TelnetSubTask task = (TelnetSubTask) tasksToRun.nextElement();
if (task instanceof TelnetRead && defaultTimeout != null) {
((TelnetRead) task).setDefaultTimeout(defaultTimeout);
@@ -163,8 +161,7 @@ public class TelnetTask extends Task {
* Process a 'typical' login. If it differs, use the read
* and write tasks explicitely
*/
- private void login()
- {
+ private void login() {
if (addCarriageReturn) {
telnet.sendString("\n", true);
}
@@ -197,8 +194,7 @@ public class TelnetTask extends Task {
/**
* Set the tcp port to connect to attribute
*/
- public void setInitialCR(boolean b)
- {
+ public void setInitialCR(boolean b) {
this.addCarriageReturn = b;
}
@@ -206,8 +202,7 @@ public class TelnetTask extends Task {
* Change the default timeout to wait for
* valid responses
*/
- public void setTimeout(Integer i)
- {
+ public void setTimeout(Integer i) {
this.defaultTimeout = i;
}
@@ -216,8 +211,7 @@ public class TelnetTask extends Task {
* Save it in our list, and return it.
*/
- public TelnetSubTask createRead()
- {
+ public TelnetSubTask createRead() {
TelnetSubTask task = (TelnetSubTask) new TelnetRead();
telnetTasks.addElement(task);
return task;
@@ -227,8 +221,7 @@ public class TelnetTask extends Task {
* A subTask <write> tag was found. Create the object,
* Save it in our list, and return it.
*/
- public TelnetSubTask createWrite()
- {
+ public TelnetSubTask createWrite() {
TelnetSubTask task = (TelnetSubTask) new TelnetWrite();
telnetTasks.addElement(task);
return task;
@@ -238,12 +231,10 @@ public class TelnetTask extends Task {
* This class is the parent of the Read and Write tasks.
* It handles the common attributes for both.
*/
- public class TelnetSubTask
- {
+ public class TelnetSubTask {
protected String taskString = "";
public void execute(AntTelnetClient telnet)
- throws BuildException
- {
+ throws BuildException {
throw new BuildException("Shouldn't be able instantiate a SubTask directly");
}
/**
@@ -255,25 +246,21 @@ public class TelnetTask extends Task {
/**
* attribute assignment of properties
*/
- public void setString(String s)
- {
+ public void setString(String s) {
taskString += s;
}
}
/**
* This class sends text to the connected server
*/
- public class TelnetWrite extends TelnetSubTask
- {
+ public class TelnetWrite extends TelnetSubTask {
private boolean echoString = true;
public void execute(AntTelnetClient telnet)
- throws BuildException
- {
+ throws BuildException {
telnet.sendString(taskString, echoString);
}
- public void setEcho(boolean b)
- {
+ public void setEcho(boolean b) {
echoString = b;
}
}
@@ -281,110 +268,93 @@ public class TelnetTask extends Task {
* This class reads the output from the connected server
* until the required string is found.
*/
- public class TelnetRead extends TelnetSubTask
- {
+ public class TelnetRead extends TelnetSubTask {
private Integer timeout = null;
public void execute(AntTelnetClient telnet)
- throws BuildException
- {
+ throws BuildException {
telnet.waitForString(taskString, timeout);
}
/**
* Override any default timeouts
*/
- public void setTimeout(Integer i)
- {
+ public void setTimeout(Integer i) {
this.timeout = i;
}
/**
* Sets the default timeout if none has been set already
*/
- public void setDefaultTimeout(Integer defaultTimeout)
- {
+ public void setDefaultTimeout(Integer defaultTimeout) {
if (timeout == null) {
timeout = defaultTimeout;
}
- }
+ }
}
/**
* This class handles the abstraction of the telnet protocol.
* Currently it is a wrapper around ORO's
* NetComponents
*/
- public class AntTelnetClient extends TelnetClient
- {
- /**
- * Read from the telnet session until the string we are
- * waiting for is found
- * @param s The string to wait on
- */
- public void waitForString(String s)
- {
- waitForString(s, null);
- }
+ public class AntTelnetClient extends TelnetClient {
+ /**
+ * Read from the telnet session until the string we are
+ * waiting for is found
+ * @param s The string to wait on
+ */
+ public void waitForString(String s) {
+ waitForString(s, null);
+ }
- /**
- * Read from the telnet session until the string we are
- * waiting for is found or the timeout has been reached
- * @param s The string to wait on
- * @param timeout The maximum number of seconds to wait
- */
- public void waitForString(String s, Integer timeout)
- {
- InputStream is = this.getInputStream();
- try {
- StringBuffer sb = new StringBuffer();
- if (timeout == null || timeout.intValue() == 0)
- {
- while (sb.toString().indexOf(s) == -1)
- {
- sb.append((char) is.read());
- }
- }
- else
- {
- Calendar endTime = Calendar.getInstance();
- endTime.add(Calendar.SECOND, timeout.intValue());
- while (sb.toString().indexOf(s) == -1)
- {
- while (Calendar.getInstance().before(endTime) &&
- is.available() == 0) {
- Thread.sleep(250);
- }
- if (is.available() == 0) {
- throw new BuildException("Response Timed-Out", getLocation());
- }
- sb.append((char) is.read());
- }
- }
- log(sb.toString(), Project.MSG_INFO);
- } catch (BuildException be)
- {
- throw be;
- } catch (Exception e)
- {
- throw new BuildException(e, getLocation());
+ /**
+ * Read from the telnet session until the string we are
+ * waiting for is found or the timeout has been reached
+ * @param s The string to wait on
+ * @param timeout The maximum number of seconds to wait
+ */
+ public void waitForString(String s, Integer timeout) {
+ InputStream is = this.getInputStream();
+ try {
+ StringBuffer sb = new StringBuffer();
+ if (timeout == null || timeout.intValue() == 0) {
+ while (sb.toString().indexOf(s) == -1){
+ sb.append((char) is.read());
+ }
+ } else {
+ Calendar endTime = Calendar.getInstance();
+ endTime.add(Calendar.SECOND, timeout.intValue());
+ while (sb.toString().indexOf(s) == -1) {
+ while (Calendar.getInstance().before(endTime) &&
+ is.available() == 0) {
+ Thread.sleep(250);
+ }
+ if (is.available() == 0) {
+ throw new BuildException("Response Timed-Out", getLocation());
+ }
+ sb.append((char) is.read());
+ }
+ }
+ log(sb.toString(), Project.MSG_INFO);
+ } catch (BuildException be) {
+ throw be;
+ } catch (Exception e) {
+ throw new BuildException(e, getLocation());
+ }
}
- }
-
- /**
- * Write this string to the telnet session.
- * @param echoString Logs string sent
- */
- public void sendString(String s, boolean echoString)
- {
- OutputStream os = this.getOutputStream();
- try {
- os.write((s + "\n").getBytes());
- if (echoString) {
- log(s, Project.MSG_INFO);
- }
- os.flush();
- } catch (Exception e)
- {
- throw new BuildException(e, getLocation());
+ /**
+ * Write this string to the telnet session.
+ * @param echoString Logs string sent
+ */
+ public void sendString(String s, boolean echoString) {
+ OutputStream os = this.getOutputStream();
+ try {
+ os.write((s + "\n").getBytes());
+ if (echoString) {
+ log(s, Project.MSG_INFO);
+ }
+ os.flush();
+ } catch (Exception e) {
+ throw new BuildException(e, getLocation());
+ }
}
- }
}
}
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/pvcs/Pvcs.java b/src/main/org/apache/tools/ant/taskdefs/optional/pvcs/Pvcs.java
index f899c6d6e..8a34c4e16 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/pvcs/Pvcs.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/pvcs/Pvcs.java
@@ -131,8 +131,7 @@ public class Pvcs extends org.apache.tools.ant.Task {
exe.setWorkingDirectory(aProj.getBaseDir());
exe.setCommandline(cmd.getCommandline());
return exe.execute();
- }
- catch (java.io.IOException e) {
+ } catch (java.io.IOException e) {
String msg = "Failed executing: " + cmd.toString()
+ ". Exception: " + e.getMessage();
throw new BuildException(msg, location);
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/sound/AntSoundPlayer.java b/src/main/org/apache/tools/ant/taskdefs/optional/sound/AntSoundPlayer.java
index 14c7ff69a..1b22d6184 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/sound/AntSoundPlayer.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/sound/AntSoundPlayer.java
@@ -139,12 +139,10 @@ public class AntSoundPlayer implements LineListener, BuildListener {
try {
audioInputStream = AudioSystem.getAudioInputStream(file);
- }
- catch (UnsupportedAudioFileException uafe) {
+ } catch (UnsupportedAudioFileException uafe) {
project.log("Audio format is not yet supported: "
+ uafe.getMessage());
- }
- catch (IOException ioe) {
+ } catch (IOException ioe) {
ioe.printStackTrace();
}
@@ -156,12 +154,10 @@ public class AntSoundPlayer implements LineListener, BuildListener {
audioClip = (Clip) AudioSystem.getLine(info);
audioClip.addLineListener(this);
audioClip.open(audioInputStream);
- }
- catch (LineUnavailableException e) {
+ } catch (LineUnavailableException e) {
project.log("The sound device is currently unavailable");
return;
- }
- catch (IOException e) {
+ } catch (IOException e) {
e.printStackTrace();
}
@@ -172,8 +168,7 @@ public class AntSoundPlayer implements LineListener, BuildListener {
}
audioClip.drain();
audioClip.close();
- }
- else {
+ } else {
project.log("Can't get data from file " + file.getName());
}
}
@@ -189,8 +184,7 @@ public class AntSoundPlayer implements LineListener, BuildListener {
clip.loop(Clip.LOOP_CONTINUOUSLY);
try {
Thread.sleep(duration);
- }
- catch (InterruptedException e) {
+ } catch (InterruptedException e) {
}
}
@@ -202,8 +196,7 @@ public class AntSoundPlayer implements LineListener, BuildListener {
if (event.getType().equals(LineEvent.Type.STOP)) {
Line line = event.getLine();
line.close();
- }
- else if (event.getType().equals(LineEvent.Type.CLOSE)) {
+ } else if (event.getType().equals(LineEvent.Type.CLOSE)) {
/*
* There is a bug in JavaSound 0.90 (jdk1.3beta).
* It prevents correct termination of the VM.
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSLABEL.java b/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSLABEL.java
index 69cd06ad9..b66f6dd47 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSLABEL.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSLABEL.java
@@ -111,8 +111,7 @@ import org.apache.tools.ant.types.Commandline;
*
* @ant.task name="vsslabel" category="scm"
*/
-public class MSVSSLABEL extends MSVSS
-{
+public class MSVSSLABEL extends MSVSS {
private String m_AutoResponse = null;
private String m_Label = null;
private String m_Version = null;
diff --git a/src/main/org/apache/tools/ant/types/FilterSet.java b/src/main/org/apache/tools/ant/types/FilterSet.java
index b873ea031..de28028e1 100644
--- a/src/main/org/apache/tools/ant/types/FilterSet.java
+++ b/src/main/org/apache/tools/ant/types/FilterSet.java
@@ -306,22 +306,18 @@ public class FilterSet extends DataType implements Cloneable {
String strValue = props.getProperty(strPropName);
filters.addElement(new Filter(strPropName, strValue));
}
- }
- catch (Exception e) {
+ } catch (Exception e) {
throw new BuildException("Could not read filters from file: "
+ filtersFile);
- }
- finally {
+ } finally {
if (in != null) {
try {
in.close();
- }
- catch (IOException ioex) {
+ } catch (IOException ioex) {
}
}
}
- }
- else {
+ } else {
throw new BuildException("Must specify a file not a directory in "
+ "the filtersfile attribute:" + filtersFile);
}
@@ -363,8 +359,7 @@ public class FilterSet extends DataType implements Cloneable {
b.append(value);
i = index + beginToken.length() + token.length()
+ endToken.length();
- }
- else {
+ } else {
// just append beginToken and search further
b.append(beginToken);
i = index + beginToken.length();
@@ -373,12 +368,10 @@ public class FilterSet extends DataType implements Cloneable {
b.append(line.substring(i));
return b.toString();
- }
- catch (StringIndexOutOfBoundsException e) {
+ } catch (StringIndexOutOfBoundsException e) {
return line;
}
- }
- else {
+ } else {
return line;
}
}
diff --git a/src/main/org/apache/tools/ant/types/Path.java b/src/main/org/apache/tools/ant/types/Path.java
index 359ae6240..dc5169023 100644
--- a/src/main/org/apache/tools/ant/types/Path.java
+++ b/src/main/org/apache/tools/ant/types/Path.java
@@ -260,8 +260,7 @@ public class Path extends DataType implements Cloneable {
File f = null;
if (getProject() != null) {
f = getProject().resolveFile(list[i]);
- }
- else {
+ } else {
f = new File(list[i]);
}
@@ -384,8 +383,7 @@ public class Path extends DataType implements Cloneable {
String pathElement = tok.nextToken();
try {
element.append(resolveFile(project, pathElement));
- }
- catch (BuildException e) {
+ } catch (BuildException e) {
project.log("Dropping path element " + pathElement
+ " as it is not valid relative to the project",
Project.MSG_VERBOSE);
@@ -585,8 +583,7 @@ public class Path extends DataType implements Cloneable {
kaffeJarFiles.setIncludes("*.jar");
addFileset(kaffeJarFiles);
- }
- else if (Project.getJavaVersion() == Project.JAVA_1_1) {
+ } else if (Project.getJavaVersion() == Project.JAVA_1_1) {
addExisting(new Path(null,
System.getProperty("java.home")
+ File.separator + "lib"
diff --git a/src/main/org/apache/tools/ant/types/PatternSet.java b/src/main/org/apache/tools/ant/types/PatternSet.java
index 90ea63b2d..d5d0d2a16 100644
--- a/src/main/org/apache/tools/ant/types/PatternSet.java
+++ b/src/main/org/apache/tools/ant/types/PatternSet.java
@@ -470,8 +470,7 @@ public class PatternSet extends DataType {
}
}
- public String toString()
- {
+ public String toString() {
return "patternSet{ includes: " + includeList +
" excludes: " + excludeList + " }";
}
diff --git a/src/main/org/apache/tools/ant/types/RegularExpression.java b/src/main/org/apache/tools/ant/types/RegularExpression.java
index 9afeee202..e7a81940b 100644
--- a/src/main/org/apache/tools/ant/types/RegularExpression.java
+++ b/src/main/org/apache/tools/ant/types/RegularExpression.java
@@ -96,8 +96,7 @@ import org.apache.tools.ant.util.regexp.RegexpFactory;
*
* @ant.datatype name="regexp"
*/
-public class RegularExpression extends DataType
-{
+public class RegularExpression extends DataType {
public final static String DATA_TYPE_NAME = "regexp";
// The regular expression factory
@@ -105,13 +104,11 @@ public class RegularExpression extends DataType
private Regexp regexp;
- public RegularExpression()
- {
+ public RegularExpression() {
this.regexp = factory.newRegexp();
}
- public void setPattern(String pattern)
- {
+ public void setPattern(String pattern) {
this.regexp.setPattern(pattern);
}
@@ -119,8 +116,7 @@ public class RegularExpression extends DataType
* Gets the pattern string for this RegularExpression in the
* given project.
*/
- public String getPattern(Project p)
- {
+ public String getPattern(Project p) {
if (isReference()) {
return getRef(p).getPattern(p);
}
@@ -128,8 +124,7 @@ public class RegularExpression extends DataType
return regexp.getPattern();
}
- public Regexp getRegexp(Project p)
- {
+ public Regexp getRegexp(Project p) {
if (isReference()) {
return getRef(p).getRegexp(p);
}
@@ -140,10 +135,8 @@ public class RegularExpression extends DataType
* Get the RegularExpression this reference refers to in
* the given project. Check for circular references too
*/
- public RegularExpression getRef(Project p)
- {
- if (!checked)
- {
+ public RegularExpression getRef(Project p) {
+ if (!checked) {
Stack stk = new Stack();
stk.push(this);
dieOnCircularReference(stk, p);
@@ -151,16 +144,12 @@ public class RegularExpression extends DataType
Object o = ref.getReferencedObject(p);
- if (!(o instanceof RegularExpression))
- {
+ if (!(o instanceof RegularExpression)) {
String msg = ref.getRefId() + " doesn\'t denote a "
+ DATA_TYPE_NAME;
throw new BuildException(msg);
- }
- else
- {
+ } else {
return (RegularExpression) o;
}
}
-
}
diff --git a/src/main/org/apache/tools/ant/types/Substitution.java b/src/main/org/apache/tools/ant/types/Substitution.java
index f676192b0..62a862e07 100644
--- a/src/main/org/apache/tools/ant/types/Substitution.java
+++ b/src/main/org/apache/tools/ant/types/Substitution.java
@@ -70,19 +70,16 @@ import org.apache.tools.ant.Project;
* @see org.apache.oro.text.regex.Perl5Substitution
* @author Matthew Inger mattinger@mindless.com
*/
-public class Substitution extends DataType
-{
+public class Substitution extends DataType {
public final static String DATA_TYPE_NAME = "substitition";
private String expression;
- public Substitution()
- {
+ public Substitution() {
this.expression = null;
}
- public void setExpression(String expression)
- {
+ public void setExpression(String expression) {
this.expression = expression;
}
@@ -90,8 +87,7 @@ public class Substitution extends DataType
* Gets the pattern string for this RegularExpression in the
* given project.
*/
- public String getExpression(Project p)
- {
+ public String getExpression(Project p) {
if (isReference()) {
return getRef(p).getExpression(p);
}
@@ -103,10 +99,8 @@ public class Substitution extends DataType
* Get the RegularExpression this reference refers to in
* the given project. Check for circular references too
*/
- public Substitution getRef(Project p)
- {
- if (!checked)
- {
+ public Substitution getRef(Project p) {
+ if (!checked) {
Stack stk = new Stack();
stk.push(this);
dieOnCircularReference(stk, p);
@@ -114,15 +108,11 @@ public class Substitution extends DataType
Object o = ref.getReferencedObject(p);
- if (!(o instanceof Substitution))
- {
+ if (!(o instanceof Substitution)) {
String msg = ref.getRefId() + " doesn\'t denote a substitution";
throw new BuildException(msg);
- }
- else
- {
+ } else {
return (Substitution) o;
}
}
-
}
diff --git a/src/main/org/apache/tools/ant/util/FileUtils.java b/src/main/org/apache/tools/ant/util/FileUtils.java
index c6209a797..52e604dc7 100644
--- a/src/main/org/apache/tools/ant/util/FileUtils.java
+++ b/src/main/org/apache/tools/ant/util/FileUtils.java
@@ -153,8 +153,7 @@ public class FileUtils {
* @throws IOException
*/
public void copyFile(String sourceFile, String destFile, FilterSetCollection filters)
- throws IOException
- {
+ throws IOException {
copyFile(new File(sourceFile), new File(destFile), filters, false, false);
}
diff --git a/src/main/org/apache/tools/ant/util/regexp/JakartaOroMatcher.java b/src/main/org/apache/tools/ant/util/regexp/JakartaOroMatcher.java
index ef9b5293f..2e0cc2de6 100644
--- a/src/main/org/apache/tools/ant/util/regexp/JakartaOroMatcher.java
+++ b/src/main/org/apache/tools/ant/util/regexp/JakartaOroMatcher.java
@@ -96,16 +96,12 @@ public class JakartaOroMatcher implements RegexpMatcher {
* Get a compiled representation of the regexp pattern
*/
protected Pattern getCompiledPattern(int options)
- throws BuildException
- {
- try
- {
+ throws BuildException {
+ try {
// compute the compiler options based on the input options first
Pattern p = compiler.compile(pattern, getCompilerOptions(options));
return p;
- }
- catch (Exception e)
- {
+ } catch (Exception e) {
throw new BuildException(e);
}
}
@@ -121,8 +117,7 @@ public class JakartaOroMatcher implements RegexpMatcher {
* Does the given argument match the pattern?
*/
public boolean matches(String input, int options)
- throws BuildException
- {
+ throws BuildException {
Pattern p = getCompiledPattern(options);
return matcher.contains(input, p);
}
@@ -144,8 +139,7 @@ public class JakartaOroMatcher implements RegexpMatcher {
* parenthesized subexpressions