conor 02/04/15 06:36:22
Modified: src/main/org/apache/tools/ant/filters BaseFilterReader.java
BaseParamFilterReader.java ClassConstants.java
ExpandProperties.java HeadFilter.java
LineContains.java LineContainsRegExp.java
PrefixLines.java ReplaceTokens.java
StringInputStream.java StripJavaComments.java
StripLineBreaks.java StripLineComments.java
TabsToSpaces.java TailFilter.java
src/main/org/apache/tools/ant/taskdefs AbstractCvsTask.java
Ant.java BZip2.java CallTarget.java DependSet.java
Ear.java Exec.java Execute.java Expand.java
FixCRLF.java GZip.java GenerateKey.java Get.java
Input.java Jar.java Java.java Javadoc.java
KeySubst.java LoadFile.java Manifest.java Pack.java
Parallel.java ProcessDestroyer.java Property.java
Replace.java SQLExec.java SendEmail.java Sleep.java
StreamPumper.java Tar.java Tstamp.java Untar.java
War.java XSLTProcess.java Zip.java
src/main/org/apache/tools/ant/taskdefs/compilers
CompilerAdapterFactory.java Javac12.java Kjc.java
src/main/org/apache/tools/ant/taskdefs/cvslib
ChangeLogParser.java
src/main/org/apache/tools/ant/taskdefs/optional
EchoProperties.java Javah.java PropertyFile.java
Rpm.java XMLValidateTask.java
src/main/org/apache/tools/ant/taskdefs/optional/ccm
CCMCreateTask.java
src/main/org/apache/tools/ant/taskdefs/optional/clearcase
ClearCase.java
src/main/org/apache/tools/ant/taskdefs/optional/ejb
BorlandDeploymentTool.java
BorlandGenerateClient.java DDCreatorHelper.java
DescriptorHandler.java EjbcHelper.java
IPlanetEjbc.java IPlanetEjbcTask.java
WeblogicTOPLinkDeploymentTool.java
src/main/org/apache/tools/ant/taskdefs/optional/ide
VAJAntTool.java VAJAntToolGUI.java
VAJLocalUtil.java
src/main/org/apache/tools/ant/taskdefs/optional/j2ee
AbstractHotDeploymentTool.java
GenericHotDeploymentTool.java
HotDeploymentTool.java JonasHotDeploymentTool.java
ServerDeploy.java WebLogicHotDeploymentTool.java
src/main/org/apache/tools/ant/taskdefs/optional/javacc
JJTree.java JavaCC.java
src/main/org/apache/tools/ant/taskdefs/optional/jdepend
JDependTask.java
src/main/org/apache/tools/ant/taskdefs/optional/jlink
ClassNameReader.java JlinkTask.java
src/main/org/apache/tools/ant/taskdefs/optional/jsp
JspC.java JspNameMangler.java WLJspc.java
src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers
DefaultJspCompilerAdapter.java JasperC.java
src/main/org/apache/tools/ant/taskdefs/optional/junit
XMLJUnitResultFormatter.java
src/main/org/apache/tools/ant/taskdefs/optional/net
MimeMail.java TelnetTask.java
src/main/org/apache/tools/ant/taskdefs/optional/pvcs
Pvcs.java
src/main/org/apache/tools/ant/taskdefs/optional/sound
AntSoundPlayer.java
src/main/org/apache/tools/ant/taskdefs/optional/vss
MSVSSLABEL.java
src/main/org/apache/tools/ant/types FilterSet.java Path.java
PatternSet.java RegularExpression.java
Substitution.java
src/main/org/apache/tools/ant/util FileUtils.java
src/main/org/apache/tools/ant/util/regexp
JakartaOroMatcher.java JakartaOroRegexp.java
JakartaRegexpMatcher.java JakartaRegexpRegexp.java
Jdk14RegexpMatcher.java Jdk14RegexpRegexp.java
Regexp.java RegexpFactory.java RegexpUtil.java
src/main/org/apache/tools/bzip2 CBZip2OutputStream.java
src/main/org/apache/tools/mail MailMessage.java
src/main/org/apache/tools/tar TarEntry.java
TarOutputStream.java
Log:
Coding Standard
Revision Changes Path
1.3 +1 -2
jakarta-ant/src/main/org/apache/tools/ant/filters/BaseFilterReader.java
Index: BaseFilterReader.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/filters/BaseFilterReader.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -u -r1.2 -r1.3
--- BaseFilterReader.java 12 Apr 2002 13:26:50 -0000 1.2
+++ BaseFilterReader.java 15 Apr 2002 13:36:16 -0000 1.3
@@ -67,8 +67,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Magesh Umasankar</a>
*/
public abstract class BaseFilterReader
- extends FilterReader
-{
+ extends FilterReader {
/** Have the parameters passed been interpreted? */
private boolean initialized = false;
1.4 +1 -2
jakarta-ant/src/main/org/apache/tools/ant/filters/BaseParamFilterReader.java
Index: BaseParamFilterReader.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/filters/BaseParamFilterReader.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -u -r1.3 -r1.4
--- BaseParamFilterReader.java 12 Apr 2002 13:26:50 -0000 1.3
+++ BaseParamFilterReader.java 15 Apr 2002 13:36:16 -0000 1.4
@@ -65,8 +65,7 @@
*/
public abstract class BaseParamFilterReader
extends BaseFilterReader
- implements Parameterizable
-{
+ implements Parameterizable {
/** The passed in parameter array. */
private Parameter[] parameters;
1.4 +1 -2
jakarta-ant/src/main/org/apache/tools/ant/filters/ClassConstants.java
Index: ClassConstants.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/filters/ClassConstants.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -u -r1.3 -r1.4
--- ClassConstants.java 12 Apr 2002 13:26:50 -0000 1.3
+++ ClassConstants.java 15 Apr 2002 13:36:16 -0000 1.4
@@ -86,8 +86,7 @@
*/
public final class ClassConstants
extends BaseFilterReader
- implements ChainableReader
-{
+ implements ChainableReader {
/** Data that must be read from, if not null. */
private String queuedData = null;
1.3 +1 -2
jakarta-ant/src/main/org/apache/tools/ant/filters/ExpandProperties.java
Index: ExpandProperties.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/filters/ExpandProperties.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -u -r1.2 -r1.3
--- ExpandProperties.java 12 Apr 2002 13:26:50 -0000 1.2
+++ ExpandProperties.java 15 Apr 2002 13:36:16 -0000 1.3
@@ -74,8 +74,7 @@
*/
public final class ExpandProperties
extends BaseFilterReader
- implements ChainableReader
-{
+ implements ChainableReader {
/** Data that must be read from, if not null. */
private String queuedData = null;
1.3 +1 -2
jakarta-ant/src/main/org/apache/tools/ant/filters/HeadFilter.java
Index: HeadFilter.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/filters/HeadFilter.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -u -r1.2 -r1.3
--- HeadFilter.java 12 Apr 2002 13:26:50 -0000 1.2
+++ HeadFilter.java 15 Apr 2002 13:36:16 -0000 1.3
@@ -76,8 +76,7 @@
*/
public final class HeadFilter
extends BaseParamFilterReader
- implements ChainableReader
-{
+ implements ChainableReader {
/** Lines key to represent the number of lines to be returned. */
private static final String LINES_KEY = "lines";
1.3 +1 -2
jakarta-ant/src/main/org/apache/tools/ant/filters/LineContains.java
Index: LineContains.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/filters/LineContains.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -u -r1.2 -r1.3
--- LineContains.java 12 Apr 2002 13:26:50 -0000 1.2
+++ LineContains.java 15 Apr 2002 13:36:16 -0000 1.3
@@ -84,8 +84,7 @@
*/
public final class LineContains
extends BaseParamFilterReader
- implements ChainableReader
-{
+ implements ChainableReader {
/** contains key */
private static final String CONTAINS_KEY = "contains";
1.3 +1 -2
jakarta-ant/src/main/org/apache/tools/ant/filters/LineContainsRegExp.java
Index: LineContainsRegExp.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/filters/LineContainsRegExp.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -u -r1.2 -r1.3
--- LineContainsRegExp.java 12 Apr 2002 13:26:50 -0000 1.2
+++ LineContainsRegExp.java 15 Apr 2002 13:36:16 -0000 1.3
@@ -84,8 +84,7 @@
*/
public final class LineContainsRegExp
extends BaseParamFilterReader
- implements ChainableReader
-{
+ implements ChainableReader {
/** contains key */
private static final String REGEXP_KEY = "regexp";
1.3 +1 -2
jakarta-ant/src/main/org/apache/tools/ant/filters/PrefixLines.java
Index: PrefixLines.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/filters/PrefixLines.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -u -r1.2 -r1.3
--- PrefixLines.java 12 Apr 2002 13:26:50 -0000 1.2
+++ PrefixLines.java 15 Apr 2002 13:36:16 -0000 1.3
@@ -76,8 +76,7 @@
*/
public final class PrefixLines
extends BaseParamFilterReader
- implements ChainableReader
-{
+ implements ChainableReader {
/** prefix key */
private static final String PREFIX_KEY = "prefix";
1.3 +1 -2
jakarta-ant/src/main/org/apache/tools/ant/filters/ReplaceTokens.java
Index: ReplaceTokens.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/filters/ReplaceTokens.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -u -r1.2 -r1.3
--- ReplaceTokens.java 12 Apr 2002 13:26:50 -0000 1.2
+++ ReplaceTokens.java 15 Apr 2002 13:36:16 -0000 1.3
@@ -81,8 +81,7 @@
*/
public final class ReplaceTokens
extends BaseParamFilterReader
- implements ChainableReader
-{
+ implements ChainableReader {
/** Default begin token character. */
private static final char DEFAULT_BEGIN_TOKEN = '@';
1.4 +1 -2
jakarta-ant/src/main/org/apache/tools/ant/filters/StringInputStream.java
Index: StringInputStream.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/filters/StringInputStream.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -u -r1.3 -r1.4
--- StringInputStream.java 12 Apr 2002 13:26:50 -0000 1.3
+++ StringInputStream.java 15 Apr 2002 13:36:16 -0000 1.4
@@ -63,8 +63,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Magesh Umasankar</a>
*/
public class StringInputStream
- extends InputStream
-{
+ extends InputStream {
/** Source string is stored as a StringReader */
private StringReader in;
1.5 +1 -2
jakarta-ant/src/main/org/apache/tools/ant/filters/StripJavaComments.java
Index: StripJavaComments.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/filters/StripJavaComments.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -w -u -r1.4 -r1.5
--- StripJavaComments.java 12 Apr 2002 13:26:50 -0000 1.4
+++ StripJavaComments.java 15 Apr 2002 13:36:16 -0000 1.5
@@ -65,8 +65,7 @@
*/
public final class StripJavaComments
extends BaseFilterReader
- implements ChainableReader
-{
+ implements ChainableReader {
private int readAheadCh = -1;
private boolean inString = false;
1.3 +1 -2
jakarta-ant/src/main/org/apache/tools/ant/filters/StripLineBreaks.java
Index: StripLineBreaks.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/filters/StripLineBreaks.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -u -r1.2 -r1.3
--- StripLineBreaks.java 12 Apr 2002 13:26:50 -0000 1.2
+++ StripLineBreaks.java 15 Apr 2002 13:36:16 -0000 1.3
@@ -72,8 +72,7 @@
*/
public final class StripLineBreaks
extends BaseParamFilterReader
- implements ChainableReader
-{
+ implements ChainableReader {
/**
* Linebreaks. What do to on funny IBM mainframes with odd line endings?
*/
1.3 +1 -2
jakarta-ant/src/main/org/apache/tools/ant/filters/StripLineComments.java
Index: StripLineComments.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/filters/StripLineComments.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -u -r1.2 -r1.3
--- StripLineComments.java 12 Apr 2002 13:26:50 -0000 1.2
+++ StripLineComments.java 15 Apr 2002 13:36:16 -0000 1.3
@@ -87,8 +87,7 @@
*/
public final class StripLineComments
extends BaseParamFilterReader
- implements ChainableReader
-{
+ implements ChainableReader {
/** The type that param recognizes to set the comments. */
private static final String COMMENTS_KEY = "comment";
1.3 +1 -2
jakarta-ant/src/main/org/apache/tools/ant/filters/TabsToSpaces.java
Index: TabsToSpaces.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/filters/TabsToSpaces.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -u -r1.2 -r1.3
--- TabsToSpaces.java 12 Apr 2002 13:26:50 -0000 1.2
+++ TabsToSpaces.java 15 Apr 2002 13:36:16 -0000 1.3
@@ -76,8 +76,7 @@
*/
public final class TabsToSpaces
extends BaseParamFilterReader
- implements ChainableReader
-{
+ implements ChainableReader {
/** The default tab length is 8 */
private static final int DEFAULT_TAB_LENGTH = 8;
1.3 +1 -2
jakarta-ant/src/main/org/apache/tools/ant/filters/TailFilter.java
Index: TailFilter.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/filters/TailFilter.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -u -r1.2 -r1.3
--- TailFilter.java 12 Apr 2002 13:26:50 -0000 1.2
+++ TailFilter.java 15 Apr 2002 13:36:16 -0000 1.3
@@ -76,8 +76,7 @@
*/
public final class TailFilter
extends BaseParamFilterReader
- implements ChainableReader
-{
+ implements ChainableReader {
/** The name that param recognizes to set the number of lines. */
private static final String LINES_KEY = "lines";
1.9 +8 -16
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/AbstractCvsTask.java
Index: AbstractCvsTask.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/AbstractCvsTask.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -w -u -r1.8 -r1.9
--- AbstractCvsTask.java 12 Apr 2002 14:46:44 -0000 1.8
+++ AbstractCvsTask.java 15 Apr 2002 13:36:17 -0000 1.9
@@ -330,36 +330,29 @@
+ "Command line was ["
+ actualCommandLine + "]",
location);
}
- }
- catch (IOException e) {
+ } catch (IOException e) {
if (failOnError) {
throw new BuildException(e, location);
- }
- else {
+ } else {
log("Caught exception: " + e.getMessage(), Project.MSG_WARN);
}
- }
- catch (BuildException e) {
+ } catch (BuildException e) {
if (failOnError) {
throw(e);
- }
- else {
+ } else {
Throwable t = e.getException();
if (t == null) {
t = e;
}
log("Caught exception: " + t.getMessage(), Project.MSG_WARN);
}
- }
- catch (Exception e) {
+ } catch (Exception e) {
if (failOnError) {
throw new BuildException(e, location);
- }
- else {
+ } else {
log("Caught exception: " + e.getMessage(), Project.MSG_WARN);
}
- }
- finally {
+ } finally {
//
// condition used to be if(output == null) outputStream.close().
This is
// not appropriate. Check if the stream itself is not
null, then close().
@@ -607,8 +600,7 @@
this.configureCommandline(c);
if (insertAtStart) {
vecCommandlines.insertElementAt(c, 0);
- }
- else {
+ } else {
vecCommandlines.addElement(c);
}
}
1.52 +1 -2
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Ant.java
Index: Ant.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Ant.java,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -w -u -r1.51 -r1.52
--- Ant.java 12 Apr 2002 15:08:17 -0000 1.51
+++ Ant.java 15 Apr 2002 13:36:17 -0000 1.52
@@ -216,8 +216,7 @@
logger.setOutputPrintStream(out);
logger.setErrorPrintStream(out);
newProject.addBuildListener(logger);
- }
- catch (IOException ex) {
+ } catch (IOException ex) {
log("Ant: Can't set output to " + output);
}
}
1.8 +1 -2
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/BZip2.java
Index: BZip2.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/BZip2.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -w -u -r1.7 -r1.8
--- BZip2.java 10 Apr 2002 14:13:59 -0000 1.7
+++ BZip2.java 15 Apr 2002 13:36:17 -0000 1.8
@@ -90,8 +90,7 @@
try {
// close up
zOut.close();
- }
- catch (IOException e) {}
+ } catch (IOException e) {}
}
}
}
1.21 +2 -4
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/CallTarget.java
Index: CallTarget.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/CallTarget.java,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -w -u -r1.20 -r1.21
--- CallTarget.java 12 Apr 2002 14:46:44 -0000 1.20
+++ CallTarget.java 15 Apr 2002 13:36:17 -0000 1.21
@@ -182,8 +182,7 @@
protected void handleOutput(String line) {
if (callee != null) {
callee.handleOutput(line);
- }
- else {
+ } else {
super.handleOutput(line);
}
}
@@ -196,8 +195,7 @@
protected void handleErrorOutput(String line) {
if (callee != null) {
callee.handleErrorOutput(line);
- }
- else {
+ } else {
super.handleErrorOutput(line);
}
}
1.14 +2 -3
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/DependSet.java
Index: DependSet.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/DependSet.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -w -u -r1.13 -r1.14
--- DependSet.java 14 Apr 2002 11:16:12 -0000 1.13
+++ DependSet.java 15 Apr 2002 13:36:17 -0000 1.14
@@ -109,7 +109,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Craeg Strong</a>
* @ant.task category="filesystem"
- * @version $Revision: 1.13 $ $Date: 2002/04/14 11:16:12 $
+ * @version $Revision: 1.14 $ $Date: 2002/04/15 13:36:17 $
* @since Ant 1.4
*/
public class DependSet extends MatchingTask {
@@ -227,8 +227,7 @@
log(targetFiles[i] + " does not exist.",
Project.MSG_VERBOSE);
upToDate = false;
continue;
- }
- else {
+ } else {
allTargets.addElement(dest);
}
if (dest.lastModified() > now) {
1.14 +2 -4
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Ear.java
Index: Ear.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Ear.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -w -u -r1.13 -r1.14
--- Ear.java 14 Apr 2002 11:16:12 -0000 1.13
+++ Ear.java 15 Apr 2002 13:36:17 -0000 1.14
@@ -118,8 +118,7 @@
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("appxml attribute is required",
location);
@@ -129,8 +128,7 @@
}
protected void zipFile(File file, ZipOutputStream zOut, String vPath)
- throws IOException
- {
+ throws IOException {
// If the file being added is META-INF/application.xml, we
// warn if it's not the one specified in the "appxml"
// attribute - or if it's being added twice, meaning the same
1.27 +2 -5
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Exec.java
Index: Exec.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Exec.java,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -w -u -r1.26 -r1.27
--- Exec.java 14 Apr 2002 11:16:12 -0000 1.26
+++ Exec.java 15 Apr 2002 13:36:17 -0000 1.27
@@ -120,8 +120,7 @@
if (!dir.equals(project.resolveFile("."))) {
if (myos.toLowerCase().indexOf("nt") >= 0) {
command = "cmd /c cd " + dir + " && " + command;
- }
- else {
+ } else {
String ant = project.getProperty("ant.home");
if (ant == null) {
throw new BuildException("Property 'ant.home' not
found", location);
@@ -237,9 +236,7 @@
this.parent = parent;
}
- public void pumpStream()
- throws IOException
- {
+ public void pumpStream() throws IOException {
byte[] buf = new byte[BUFFER_SIZE];
if (!endOfStream) {
String line = din.readLine();
1.40 +55 -87
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Execute.java
Index: Execute.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Execute.java,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -w -u -r1.39 -r1.40
--- Execute.java 15 Apr 2002 08:39:18 -0000 1.39
+++ Execute.java 15 Apr 2002 13:36:17 -0000 1.40
@@ -79,7 +79,7 @@
*
* @since Ant 1.2
*
- * @version $Revision: 1.39 $
+ * @version $Revision: 1.40 $
*/
public class Execute {
@@ -113,28 +113,24 @@
// Try using a JDK 1.3 launcher
try {
vmLauncher = new Java13CommandLauncher();
- }
- catch (NoSuchMethodException exc) {
+ } catch (NoSuchMethodException exc) {
// Ignore and keep trying
}
if (Os.isFamily("mac")) {
// Mac
shellLauncher = new MacCommandLauncher(new CommandLauncher());
- }
- else if (Os.isFamily("os/2")) {
+ } else if (Os.isFamily("os/2")) {
// OS/2 - use same mechanism as Windows 2000
shellLauncher = new WinNTCommandLauncher(new CommandLauncher());
- }
- else if (Os.isFamily("windows")) {
+ } else if (Os.isFamily("windows")) {
// Windows. Need to determine which JDK we're running in
CommandLauncher baseLauncher;
if (System.getProperty("java.version").startsWith("1.1")) {
// JDK 1.1
baseLauncher = new Java11CommandLauncher();
- }
- else {
+ } else {
// JDK 1.2
baseLauncher = new CommandLauncher();
}
@@ -142,27 +138,23 @@
if (!Os.isFamily("win9x")) {
// Windows XP/2000/NT
shellLauncher = new WinNTCommandLauncher(baseLauncher);
- }
- else {
+ } else {
// Windows 98/95 - need to use an auxiliary script
shellLauncher = new ScriptCommandLauncher("bin/antRun.bat",
baseLauncher);
}
- }
- else if (Os.isFamily("netware")) {
+ } else if (Os.isFamily("netware")) {
// NetWare. Need to determine which JDK we're running in
CommandLauncher baseLauncher;
if (System.getProperty("java.version").startsWith("1.1")) {
// JDK 1.1
baseLauncher = new Java11CommandLauncher();
- }
- else {
+ } else {
// JDK 1.2
baseLauncher = new CommandLauncher();
}
shellLauncher = new PerlScriptCommandLauncher("bin/antRun.pl",
baseLauncher);
- }
- else {
+ } else {
// Generic
shellLauncher = new ScriptCommandLauncher("bin/antRun", new
CommandLauncher());
}
@@ -198,12 +190,10 @@
// contain embedded new lines).
if (var == null) {
var = lineSep + line;
- }
- else {
+ } else {
var += lineSep + line;
}
- }
- else {
+ } else {
// New env var...append the previous one if we have it.
if (var != null) {
procEnvironment.addElement(var);
@@ -215,8 +205,7 @@
if (var != null) {
procEnvironment.addElement(var);
}
- }
- catch (java.io.IOException exc) {
+ } catch (java.io.IOException exc) {
exc.printStackTrace();
// Just try to see how much we got
}
@@ -229,31 +218,26 @@
// Not sure
String[] cmd = {"cmd", "/c", "set" };
return cmd;
- }
- else if (Os.isFamily("windows")) {
+ } else if (Os.isFamily("windows")) {
// Determine if we're running under XP/2000/NT or 98/95
if (!Os.isFamily("win9x")) {
// Windows XP/2000/NT
String[] cmd = {"cmd", "/c", "set" };
return cmd;
- }
- else {
+ } else {
// Windows 98/95
String[] cmd = {"command.com", "/c", "set" };
return cmd;
}
- }
- else if (Os.isFamily("unix")) {
+ } else if (Os.isFamily("unix")) {
// Generic UNIX
// Alternatively one could use: /bin/sh -c env
String[] cmd = {"/usr/bin/env"};
return cmd;
- }
- else if (Os.isFamily("netware")) {
+ } else if (Os.isFamily("netware")) {
String[] cmd = {"env"};
return cmd;
- }
- else {
+ } else {
// MAC OS 9 and previous
// TODO: I have no idea how to get it, someone must fix it
String[] cmd = null;
@@ -528,8 +512,7 @@
throw new BuildException(cmdline[0]
+ " failed with return code " + retval,
task.getLocation());
}
- }
- catch (java.io.IOException exc) {
+ } catch (java.io.IOException exc) {
throw new BuildException("Could not launch " + cmdline[0] + ": "
+ exc, task.getLocation());
}
@@ -540,8 +523,7 @@
* a general purpose command launcher which can only launch commands in
* the current working directory.
*/
- private static class CommandLauncher
- {
+ private static class CommandLauncher {
/**
* Launches the given command in a new process.
*
@@ -610,10 +592,8 @@
* A command launcher for JDK/JRE 1.3 (and higher). Uses the built-in
* Runtime.exec() command
*/
- private static class Java13CommandLauncher extends CommandLauncher
- {
- public Java13CommandLauncher() throws NoSuchMethodException
- {
+ private static class Java13CommandLauncher extends CommandLauncher {
+ public Java13CommandLauncher() throws NoSuchMethodException {
// Locate method Runtime.exec(String[] cmdarray,
// String[] envp, File dir)
_execWithCWD = Runtime.class.getMethod("exec",
@@ -624,9 +604,8 @@
* Launches the given command in a new process, in the given working
* directory
*/
- public Process exec(Project project, String[] cmd, String[] env,
File workingDir)
- throws IOException
- {
+ public Process exec(Project project, String[] cmd, String[] env,
+ File workingDir) throws IOException {
try {
if (project != null) {
project.log("Execute:Java13CommandLauncher: " +
@@ -635,20 +614,16 @@
Object[] arguments = { cmd, env, workingDir };
return (Process) _execWithCWD.invoke(Runtime.getRuntime(),
arguments);
- }
- catch (InvocationTargetException exc) {
+ } catch (InvocationTargetException exc) {
Throwable realexc = exc.getTargetException();
if (realexc instanceof ThreadDeath) {
throw (ThreadDeath) realexc;
- }
- else if (realexc instanceof IOException) {
+ } else if (realexc instanceof IOException) {
throw (IOException) realexc;
- }
- else {
+ } else {
throw new BuildException("Unable to execute command",
realexc);
}
- }
- catch (Exception exc) {
+ } catch (Exception exc) {
// IllegalAccess, IllegalArgument, ClassCast
throw new BuildException("Unable to execute command", exc);
}
@@ -662,10 +637,8 @@
*
* Sub-classes override exec(args, env, workdir)
*/
- private static class CommandLauncherProxy extends CommandLauncher
- {
- CommandLauncherProxy(CommandLauncher launcher)
- {
+ private static class CommandLauncherProxy extends CommandLauncher {
+ CommandLauncherProxy(CommandLauncher launcher) {
_launcher = launcher;
}
@@ -673,8 +646,8 @@
* Launches the given command in a new process. Delegates this
* method to the proxied launcher
*/
- public Process exec(Project project, String[] cmd, String[] env)
throws IOException
- {
+ public Process exec(Project project, String[] cmd, String[] env)
+ throws IOException {
return _launcher.exec(project, cmd, env);
}
@@ -686,10 +659,8 @@
* launching commands in directories other than the current working
* directory.
*/
- private static class WinNTCommandLauncher extends CommandLauncherProxy
- {
- WinNTCommandLauncher(CommandLauncher launcher)
- {
+ private static class WinNTCommandLauncher extends CommandLauncherProxy {
+ WinNTCommandLauncher(CommandLauncher launcher) {
super(launcher);
}
@@ -697,8 +668,8 @@
* Launches the given command in a new process, in the given working
* directory.
*/
- public Process exec(Project project, String[] cmd, String[] env,
File workingDir) throws IOException
- {
+ public Process exec(Project project, String[] cmd, String[] env,
+ File workingDir) throws IOException {
File commandDir = workingDir;
if (workingDir == null) {
if (project != null) {
@@ -728,10 +699,8 @@
* A command launcher for Mac that uses a dodgy mechanism to change
* working directory before launching commands.
*/
- private static class MacCommandLauncher extends CommandLauncherProxy
- {
- MacCommandLauncher(CommandLauncher launcher)
- {
+ private static class MacCommandLauncher extends CommandLauncherProxy {
+ MacCommandLauncher(CommandLauncher launcher) {
super(launcher);
}
@@ -739,8 +708,8 @@
* Launches the given command in a new process, in the given working
* directory
*/
- public Process exec(Project project, String[] cmd, String[] env,
File workingDir) throws IOException
- {
+ public Process exec(Project project, String[] cmd, String[] env,
+ File workingDir) throws IOException {
if (workingDir == null) {
return exec(project, cmd, env);
}
@@ -748,8 +717,7 @@
System.getProperties().put("user.dir",
workingDir.getAbsolutePath());
try {
return exec(project, cmd, env);
- }
- finally {
+ } finally {
System.getProperties().put("user.dir", antWorkingDirectory);
}
}
@@ -759,10 +727,8 @@
* A command launcher that uses an auxiliary script to launch commands
* in directories other than the current working directory.
*/
- private static class ScriptCommandLauncher extends CommandLauncherProxy
- {
- ScriptCommandLauncher(String script, CommandLauncher launcher)
- {
+ private static class ScriptCommandLauncher extends CommandLauncherProxy {
+ ScriptCommandLauncher(String script, CommandLauncher launcher) {
super(launcher);
_script = script;
}
@@ -771,8 +737,8 @@
* Launches the given command in a new process, in the given working
* directory
*/
- public Process exec(Project project, String[] cmd, String[] env,
File workingDir) throws IOException
- {
+ public Process exec(Project project, String[] cmd, String[] env,
+ File workingDir) throws IOException {
if (project == null) {
if (workingDir == null) {
return exec(project, cmd, env);
@@ -783,7 +749,8 @@
// Locate the auxiliary script
String antHome = project.getProperty("ant.home");
if (antHome == null) {
- throw new IOException("Cannot locate antRun script: Property
'ant.home' not found");
+ throw new IOException("Cannot locate antRun script: "
+ + "Property 'ant.home' not found");
}
String antRun = project.resolveFile(antHome + File.separator +
_script).toString();
@@ -808,10 +775,9 @@
* A command launcher that uses an auxiliary perl script to launch
commands
* in directories other than the current working directory.
*/
- private static class PerlScriptCommandLauncher extends
CommandLauncherProxy
- {
- PerlScriptCommandLauncher(String script, CommandLauncher launcher)
- {
+ private static class PerlScriptCommandLauncher
+ extends CommandLauncherProxy {
+ PerlScriptCommandLauncher(String script, CommandLauncher launcher) {
super(launcher);
_script = script;
}
@@ -820,19 +786,21 @@
* Launches the given command in a new process, in the given working
* directory
*/
- public Process exec(Project project, String[] cmd, String[] env,
File workingDir) throws IOException
- {
+ public Process exec(Project project, String[] cmd, String[] env,
+ File workingDir) throws IOException {
if (project == null) {
if (workingDir == null) {
return exec(project, cmd, env);
}
- throw new IOException("Cannot locate antRun script: No
project provided");
+ throw new IOException("Cannot locate antRun script: "
+ + "No project provided");
}
// Locate the auxiliary script
String antHome = project.getProperty("ant.home");
if (antHome == null) {
- throw new IOException("Cannot locate antRun script: Property
'ant.home' not found");
+ throw new IOException("Cannot locate antRun script: "
+ + "Property 'ant.home' not found");
}
String antRun = project.resolveFile(antHome + File.separator +
_script).toString();
1.30 +1 -2
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Expand.java
Index: Expand.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Expand.java,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -w -u -r1.29 -r1.30
--- Expand.java 14 Apr 2002 11:16:12 -0000 1.29
+++ Expand.java 15 Apr 2002 13:36:17 -0000 1.30
@@ -166,8 +166,7 @@
if (zis != null) {
try {
zis.close();
- }
- catch (IOException e) {}
+ } catch (IOException e) {}
}
}
}
1.35 +15 -29
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java
Index: FixCRLF.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -w -u -r1.34 -r1.35
--- FixCRLF.java 14 Apr 2002 11:16:12 -0000 1.34
+++ FixCRLF.java 15 Apr 2002 13:36:17 -0000 1.35
@@ -116,7 +116,7 @@
*
* @author Sam Ruby <a href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Peter B. West</a>
- * @version $Revision: 1.34 $ $Name: $
+ * @version $Revision: 1.35 $ $Name: $
* @since Ant 1.1
*
* @ant.task category="filesystem"
@@ -455,8 +455,7 @@
// End of multiLineComment on this line
endComment += 2; // Include the end token
lines.setState(LOOKING);
- }
- else {
+ } else {
endComment = linelen;
}
@@ -489,8 +488,7 @@
tablength -
(line.getColumn()
% tablength));
- }
- else {
+ } else {
line.incColumn();
}
}
@@ -548,8 +546,7 @@
try {
lines.close();
lines = null;
- }
- catch (IOException e) {
+ } catch (IOException e) {
throw new BuildException("Unable to close source file "
+ srcFile);
}
@@ -627,8 +624,7 @@
* before the terminator is found.
*/
private void nextStateChange(OneLiner.BufferLine bufline)
- throws BuildException
- {
+ throws BuildException {
int eol = bufline.length();
int ptr = bufline.getNext();
@@ -650,8 +646,7 @@
bufline.setState(IN_MULTI_COMMENT);
bufline.setLookahead(--ptr);
return;
- }
- else if (bufline.getChar(ptr) == '/') {
+ } else if (bufline.getChar(ptr) == '/') {
bufline.setState(IN_SINGLE_COMMENT);
bufline.setLookahead(--ptr);
return;
@@ -680,8 +675,7 @@
* before the terminator is found.
*/
private void endOfCharConst(OneLiner.BufferLine bufline, char terminator)
- throws BuildException
- {
+ throws BuildException {
int ptr = bufline.getNext();
int eol = bufline.length();
char c;
@@ -689,8 +683,7 @@
while (ptr < eol) {
if ((c = bufline.getChar(ptr++)) == '\\') {
ptr++;
- }
- else {
+ } else {
if (c == terminator) {
bufline.setLookahead(ptr);
return;
@@ -714,8 +707,7 @@
* @param BufferedWriter outWriter Sink for the processed string
*/
private void notInConstant(OneLiner.BufferLine bufline, int end,
- BufferedWriter outWriter)
- {
+ BufferedWriter outWriter) {
// N.B. both column and string index are zero-based
// Process a string not part of a constant;
// i.e. convert tabs<->spaces as required
@@ -747,8 +739,7 @@
} catch (IOException e) {
throw new BuildException(e);
} // end of try-catch
- }
- else { // tabs == ADD
+ } else { // tabs == ADD
int tabCol;
linebuf2.setLength(0);
place = 0;
@@ -780,8 +771,7 @@
linebuf2.append(linestring.substring(
place, ++tabCol - placediff));
linebuf2.append('\t');
- }
- else {
+ } else {
linebuf2.append(linestring.substring(
place, nextStop - placediff));
} // end of else
@@ -819,8 +809,7 @@
private boolean reachedEof = false;
public OneLiner(File srcFile)
- throws BuildException
- {
+ throws BuildException {
try {
reader = new BufferedReader
(getReader(srcFile), INBUFLEN);
@@ -924,14 +913,12 @@
this.state = state;
}
- public boolean hasMoreElements()
- {
+ public boolean hasMoreElements() {
return !reachedEof;
}
public Object nextElement()
- throws NoSuchElementException
- {
+ throws NoSuchElementException {
if (!hasMoreElements()) {
throw new NoSuchElementException("OneLiner");
}
@@ -955,8 +942,7 @@
private String eolStr;
public BufferLine(String line, String eolStr)
- throws BuildException
- {
+ throws BuildException {
next = 0;
column = 0;
this.line = line;
1.20 +2 -1
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/GZip.java
Index: GZip.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/GZip.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -w -u -r1.19 -r1.20
--- GZip.java 11 Apr 2002 07:38:15 -0000 1.19
+++ GZip.java 15 Apr 2002 13:36:17 -0000 1.20
@@ -87,8 +87,9 @@
try {
// close up
zOut.close();
+ } catch (IOException e) {
+ // do nothing
}
- catch (IOException e) {}
}
}
}
1.15 +2 -4
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/GenerateKey.java
Index: GenerateKey.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/GenerateKey.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -w -u -r1.14 -r1.15
--- GenerateKey.java 14 Apr 2002 11:16:12 -0000 1.14
+++ GenerateKey.java 15 Apr 2002 13:36:17 -0000 1.15
@@ -137,8 +137,7 @@
int start = 0;
- while (-1 != end)
- {
+ while (-1 != end) {
sb.append(string.substring(start, end));
sb.append("\\,");
start = end + 1;
@@ -306,8 +305,7 @@
sb.append("-keypass \"");
if (null != keypass) {
sb.append(keypass);
- }
- else {
+ } else {
sb.append(storepass);
}
sb.append("\" ");
1.20 +6 -13
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Get.java
Index: Get.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Get.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -w -u -r1.19 -r1.20
--- Get.java 14 Apr 2002 11:16:12 -0000 1.19
+++ Get.java 15 Apr 2002 13:36:17 -0000 1.20
@@ -150,8 +150,7 @@
Class.forName("sun.misc.BASE64Encoder").newInstance();
encoding = encoder.encode (up.getBytes());
- }
- catch (Exception ex) { // sun's base64 encoder isn't
available
+ } catch (Exception ex) { // sun's base64 encoder isn't
available
Base64Converter encoder = new Base64Converter();
encoding = encoder.encode(up.getBytes());
}
@@ -339,8 +338,7 @@
* <a HREF="[EMAIL PROTECTED]">Gautam Guliani</a>
*********************************************************************/
- class Base64Converter
- {
+ class Base64Converter {
public final char [ ] alphabet = {
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', // 0 to 7
@@ -353,13 +351,11 @@
'4', '5', '6', '7', '8', '9', '+', '/' }; // 56 to 63
- public String encode(String s)
- {
+ public String encode(String s) {
return encode (s.getBytes());
}
- public String encode(byte[ ] octetString)
- {
+ public String encode(byte[ ] octetString) {
int bits24;
int bits6;
@@ -384,8 +380,7 @@
out[outIndex++] = alphabet[bits6];
}
- if (octetString.length - i == 2)
- {
+ if (octetString.length - i == 2) {
// store the octets
bits24 = (octetString[i] & 0xFF) << 16;
bits24 |= (octetString[i + 1] & 0xFF) << 8;
@@ -398,9 +393,7 @@
// padding
out[outIndex++] = '=';
- }
- else if (octetString.length - i == 1)
- {
+ } else if (octetString.length - i == 1) {
// store the octets
bits24 = (octetString[i] & 0xFF) << 16;
bits6 = (bits24 & 0x00FC0000) >> 18;
1.10 +4 -6
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Input.java
Index: Input.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Input.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -w -u -r1.9 -r1.10
--- Input.java 3 Mar 2002 01:46:20 -0000 1.9
+++ Input.java 15 Apr 2002 13:36:17 -0000 1.10
@@ -151,10 +151,9 @@
} catch (IOException e) {
throw new BuildException("Failed to read input from
Console.", e);
}
- }
+ } else {
// not quite the original intention of this task but for the sake
// of testing ;-)
- else {
if (accept != null && (!accept.contains(input))) {
throw new BuildException("Invalid input please reenter.");
}
@@ -163,8 +162,7 @@
if (addproperty != null) {
if (project.getProperty(addproperty) == null) {
project.setProperty(addproperty, input);
- }
- else {
+ } else {
log("Override ignored for " + addproperty,
Project.MSG_VERBOSE);
}
}
1.49 +20 -40
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Jar.java
Index: Jar.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Jar.java,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -w -u -r1.48 -r1.49
--- Jar.java 15 Apr 2002 08:39:18 -0000 1.48
+++ Jar.java 15 Apr 2002 13:36:17 -0000 1.49
@@ -176,8 +176,7 @@
try {
r = new FileReader(manifestFile);
newManifest = getManifest(r);
- }
- catch (IOException e) {
+ } catch (IOException e) {
throw new BuildException("Unable to read manifest file: "
+ manifestFile
+ " (" + e.getMessage() + ")", e);
@@ -185,8 +184,7 @@
if (r != null) {
try {
r.close();
- }
- catch (IOException e) {
+ } catch (IOException e) {
// do nothing
}
}
@@ -199,13 +197,11 @@
Manifest newManifest = null;
try {
newManifest = new Manifest(r);
- }
- catch (ManifestException e) {
+ } catch (ManifestException e) {
log("Manifest is invalid: " + e.getMessage(), Project.MSG_ERR);
throw new BuildException("Invalid Manifest: " + manifestFile,
e, getLocation());
- }
- catch (IOException e) {
+ } catch (IOException e) {
throw new BuildException("Unable to read manifest file"
+ " (" + e.getMessage() + ")", e);
}
@@ -225,8 +221,7 @@
}
protected void initZipOutputStream(ZipOutputStream zOut)
- throws IOException, BuildException
- {
+ throws IOException, BuildException {
String ls = System.getProperty("line.separator");
try {
@@ -240,14 +235,12 @@
finalManifest.merge(filesetManifest);
finalManifest.merge(configuredManifest);
finalManifest.merge(manifest, !mergeManifestsMain);
- }
- else if (configuredManifest != null) {
+ } else if (configuredManifest != null) {
// configuredManifest is the final merge
finalManifest.merge(filesetManifest);
finalManifest.merge(configuredManifest,
!mergeManifestsMain);
- }
- else if (filesetManifest != null) {
+ } else if (filesetManifest != null) {
// filesetManifest is the final (and only) merge
finalManifest.merge(filesetManifest,
!mergeManifestsMain);
}
@@ -280,12 +273,10 @@
super.zipFile(bais, zOut, "META-INF/MANIFEST.MF",
System.currentTimeMillis(), null);
super.initZipOutputStream(zOut);
- }
- catch (ManifestException e) {
+ } catch (ManifestException e) {
log("Manifest is invalid: " + e.getMessage(), Project.MSG_ERR);
throw new BuildException("Invalid Manifest", e, getLocation());
- }
- finally {
+ } finally {
System.getProperties().put("line.separator", ls);
}
}
@@ -355,8 +346,7 @@
* Overriden from Zip class to deal with manifests
*/
protected void zipFile(File file, ZipOutputStream zOut, String vPath)
- throws IOException
- {
+ throws IOException {
if ("META-INF/MANIFEST.MF".equalsIgnoreCase(vPath)) {
filesetManifest(file, null);
} else {
@@ -369,8 +359,7 @@
*/
protected void zipFile(InputStream is, ZipOutputStream zOut, String
vPath,
long lastModified, File file)
- throws IOException
- {
+ throws IOException {
if ("META-INF/MANIFEST.MF".equalsIgnoreCase(vPath)) {
filesetManifest(file, is);
} else {
@@ -385,31 +374,26 @@
log("Found manifest " + file, Project.MSG_VERBOSE);
if (is != null) {
manifest = getManifest(new InputStreamReader(is));
- }
- else {
+ } else {
manifest = getManifest(file);
}
- }
- else if (mergeManifests) {
+ } else if (mergeManifests) {
// we add this to our group of fileset manifests
log("Found manifest to merge in file " + file,
Project.MSG_VERBOSE);
- try
- {
+ try {
Manifest newManifest = getManifest(new
InputStreamReader(is));
if (filesetManifest == null) {
filesetManifest = newManifest;
} else {
filesetManifest.merge(newManifest);
}
- }
- catch (ManifestException e) {
+ } catch (ManifestException e) {
log("Manifest in file " + file + " is invalid: " +
e.getMessage(), Project.MSG_ERR);
throw new BuildException("Invalid Manifest", e,
getLocation());
}
- }
- else {
+ } else {
// assuming 'skip' otherwise
log("File " + file
+ " includes a META-INF/MANIFEST.MF which will be ignored. "
@@ -451,26 +435,22 @@
Project.MSG_VERBOSE);
return false;
}
- }
- catch (Exception e) {
+ } catch (Exception e) {
// any problems and we will rebuild
log("Updating jar since cannot read current jar manifest: "
+ e.getClass().getName() + " - " + e.getMessage(),
Project.MSG_VERBOSE);
return false;
- }
- finally {
+ } finally {
if (theZipFile != null) {
try {
theZipFile.close();
- }
- catch (IOException e) {
+ } catch (IOException e) {
//ignore
}
}
}
- }
- else if (manifestFile.lastModified() > zipFile.lastModified()) {
+ } else if (manifestFile.lastModified() > zipFile.lastModified()) {
return false;
}
return super.isUpToDate(scanners, zipFile);
1.42 +2 -4
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Java.java
Index: Java.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Java.java,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -w -u -r1.41 -r1.42
--- Java.java 14 Apr 2002 11:16:12 -0000 1.41
+++ Java.java 15 Apr 2002 13:36:17 -0000 1.42
@@ -396,14 +396,12 @@
exe.execute(project);
} catch (IOException io) {
throw new BuildException(io, location);
- }
- finally {
+ } finally {
if (outStream != null) {
outStream.close();
}
}
- }
- else {
+ } else {
exe.execute(project);
}
}
1.89 +6 -12
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Javadoc.java
Index: Javadoc.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Javadoc.java,v
retrieving revision 1.88
retrieving revision 1.89
diff -u -w -u -r1.88 -r1.89
--- Javadoc.java 14 Apr 2002 11:16:12 -0000 1.88
+++ Javadoc.java 15 Apr 2002 13:36:17 -0000 1.89
@@ -776,8 +776,7 @@
Project.MSG_VERBOSE);
}
gotAll = true;
- }
- else {
+ } else {
int i;
for (i = 0; i < SCOPE_ELEMENTS.length; i++) {
if (next.equals (SCOPE_ELEMENTS[i]))
@@ -786,8 +785,7 @@
if (i == SCOPE_ELEMENTS.length) {
throw new BuildException ("Unrecognised scope
element: "
+ next);
- }
- else {
+ } else {
if (elements[i]) {
getProject().log ("Repeated tag scope element: "
+ next, Project.MSG_VERBOSE);
@@ -808,8 +806,7 @@
}
if (gotAll) {
this.scope = "a";
- }
- else {
+ } else {
StringBuffer buff = new StringBuffer (elements.length);
for (int i = 0; i < elements.length; i++) {
if (elements[i]) {
@@ -998,8 +995,7 @@
if (doclet.getName() == null) {
throw new BuildException("The doclet name must be "
+ "specified.", location);
- }
- else {
+ } else {
toExecute.createArgument().setValue("-doclet");
toExecute.createArgument().setValue(doclet.getName());
if (doclet.getPath() != null) {
@@ -1060,13 +1056,11 @@
toExecute.createArgument()
.setValue(packageListLocation
.getAbsolutePath());
- }
- else {
+ } else {
log("Warning: No package list was found at "
+ packageListLocation, Project.MSG_VERBOSE);
}
- }
- else {
+ } else {
toExecute.createArgument().setValue("-link");
toExecute.createArgument().setValue(la.getHref());
}
1.15 +2 -4
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/KeySubst.java
Index: KeySubst.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/KeySubst.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -w -u -r1.14 -r1.15
--- KeySubst.java 14 Apr 2002 11:16:12 -0000 1.14
+++ KeySubst.java 15 Apr 2002 13:36:17 -0000 1.15
@@ -179,8 +179,7 @@
}
- public static void main(String[] args)
- {
+ public static void main(String[] args) {
try {
Hashtable hash = new Hashtable();
hash.put("VERSION", "1.0.3");
@@ -198,8 +197,7 @@
@return the string with the replacements in it.
*/
public static String replace(String origString, Hashtable keys)
- throws BuildException
- {
+ throws BuildException {
StringBuffer finalString = new StringBuffer();
int index = 0;
int i = 0;
1.17 +3 -6
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/LoadFile.java
Index: LoadFile.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/LoadFile.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -w -u -r1.16 -r1.17
--- LoadFile.java 14 Apr 2002 11:16:12 -0000 1.16
+++ LoadFile.java 15 Apr 2002 13:36:17 -0000 1.17
@@ -178,8 +178,7 @@
bis = new BufferedInputStream(fis);
if (encoding == null) {
instream = new InputStreamReader(bis);
- }
- else {
+ } else {
instream = new InputStreamReader(bis, encoding);
}
@@ -203,15 +202,13 @@
final String message = "Unable to load file: " + ioe.toString();
if (failOnError) {
throw new BuildException(message, ioe, location);
- }
- else {
+ } else {
log(message, Project.MSG_ERR);
}
} catch (final BuildException be) {
if (failOnError) {
throw be;
- }
- else {
+ } else {
log(be.getMessage(), Project.MSG_ERR);
}
} finally {
1.32 +1 -2
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Manifest.java
Index: Manifest.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Manifest.java,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -w -u -r1.31 -r1.32
--- Manifest.java 15 Apr 2002 12:11:47 -0000 1.31
+++ Manifest.java 15 Apr 2002 13:36:17 -0000 1.32
@@ -1068,8 +1068,7 @@
if (mode.getValue().equals("update") && manifestFile.exists()) {
if (current != null) {
toWrite.merge(current);
- }
- else if (error != null) {
+ } else if (error != null) {
throw error;
}
}
1.8 +2 -4
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Pack.java
Index: Pack.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Pack.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -w -u -r1.7 -r1.8
--- Pack.java 14 Apr 2002 11:16:12 -0000 1.7
+++ Pack.java 15 Apr 2002 13:36:17 -0000 1.8
@@ -117,8 +117,7 @@
}
private void zipFile(InputStream in, OutputStream zOut)
- throws IOException
- {
+ throws IOException {
byte[] buffer = new byte[8 * 1024];
int count = 0;
do {
@@ -128,8 +127,7 @@
}
protected void zipFile(File file, OutputStream zOut)
- throws IOException
- {
+ throws IOException {
FileInputStream fIn = new FileInputStream(file);
try {
zipFile(fIn, zOut);
1.10 +4 -8
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Parallel.java
Index: Parallel.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Parallel.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -w -u -r1.9 -r1.10
--- Parallel.java 15 Apr 2002 12:11:47 -0000 1.9
+++ Parallel.java 15 Apr 2002 13:36:17 -0000 1.10
@@ -112,8 +112,7 @@
for (int i = 0; i < threads.length; ++i) {
try {
threads[i].join();
- }
- catch (InterruptedException ie) {
+ } catch (InterruptedException ie) {
// who would interrupt me at a time like this?
}
}
@@ -142,12 +141,10 @@
if (numExceptions == 1) {
if (firstException instanceof BuildException) {
throw (BuildException) firstException;
- }
- else {
+ } else {
throw new BuildException(firstException);
}
- }
- else if (numExceptions > 1) {
+ } else if (numExceptions > 1) {
throw new BuildException(exceptionMessage.toString(),
firstLocation);
}
@@ -175,8 +172,7 @@
public void run() {
try {
task.perform();
- }
- catch (Throwable t) {
+ } catch (Throwable t) {
exception = t;
}
}
1.4 +9 -19
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/ProcessDestroyer.java
Index: ProcessDestroyer.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/ProcessDestroyer.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -u -r1.3 -r1.4
--- ProcessDestroyer.java 14 Apr 2002 11:16:12 -0000 1.3
+++ ProcessDestroyer.java 15 Apr 2002 13:36:17 -0000 1.4
@@ -65,8 +65,7 @@
* @since Ant 1.5
*/
class ProcessDestroyer
- extends Thread
-{
+ extends Thread {
private Vector processes = new Vector();
@@ -74,10 +73,8 @@
* Constructs a <code>ProcessDestroyer</code> 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 @@
//
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 @@
* @return <code>true</code> if the specified <code>Process</code> was
* successfully added
*/
- public boolean add(Process process)
- {
+ public boolean add(Process process) {
processes.addElement(process);
return processes.contains(process);
}
@@ -117,21 +111,17 @@
* @return <code>true</code> if the specified <code>Process</code> 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();
}
}
1.48 +1 -2
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Property.java
Index: Property.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Property.java,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -w -u -r1.47 -r1.48
--- Property.java 14 Apr 2002 11:16:12 -0000 1.47
+++ Property.java 15 Apr 2002 13:36:17 -0000 1.48
@@ -377,8 +377,7 @@
if (props.containsKey(propertyName)) {
fragment =
props.getProperty(propertyName);
resolved = false;
- }
- else {
+ } else {
fragment = "${" + propertyName + "}";
}
}
1.29 +8 -16
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Replace.java
Index: Replace.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Replace.java,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -w -u -r1.28 -r1.29
--- Replace.java 14 Apr 2002 11:16:13 -0000 1.28
+++ Replace.java 15 Apr 2002 13:36:17 -0000 1.29
@@ -126,8 +126,7 @@
}
//Inner class
- public class Replacefilter
- {
+ public class Replacefilter {
private String token;
private String value;
private String property;
@@ -173,18 +172,14 @@
}
}
- 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 @@
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 @@
//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
1.40 +8 -16
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/SQLExec.java
Index: SQLExec.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/SQLExec.java,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -w -u -r1.39 -r1.40
--- SQLExec.java 14 Apr 2002 11:16:13 -0000 1.39
+++ SQLExec.java 15 Apr 2002 13:36:17 -0000 1.40
@@ -484,8 +484,7 @@
}
}
dc = loader.loadClass(driver);
- }
- else {
+ } else {
log("Loading " + driver + " using system loader.",
Project.MSG_VERBOSE);
dc = Class.forName(driver);
@@ -568,8 +567,7 @@
conn.commit();
}
}
- }
- finally {
+ } finally {
if (out != null && out != System.out) {
out.close();
}
@@ -588,8 +586,7 @@
} catch (SQLException ex) {}
}
throw new BuildException(e, location);
- }
- finally {
+ } finally {
try {
if (statement != null) {
statement.close();
@@ -597,8 +594,7 @@
if (conn != null) {
conn.close();
}
- }
- catch (SQLException e) {}
+ } catch (SQLException e) {}
}
log(goodSql + " of " + totalSql +
@@ -697,8 +693,7 @@
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 @@
if (!statement.execute(sql)) {
log(statement.getUpdateCount() + " rows affected",
Project.MSG_VERBOSE);
- }
- else {
+ } else {
if (print) {
printResults(out);
}
@@ -735,8 +729,7 @@
}
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 @@
if (first) {
first = false;
- }
- else {
+ } else {
line.append(",");
}
line.append(columnValue);
1.15 +1 -2
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/SendEmail.java
Index: SendEmail.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/SendEmail.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -w -u -r1.14 -r1.15
--- SendEmail.java 14 Apr 2002 11:16:13 -0000 1.14
+++ SendEmail.java 15 Apr 2002 13:36:17 -0000 1.15
@@ -110,8 +110,7 @@
*
* @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.
1.10 +3 -6
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Sleep.java
Index: Sleep.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Sleep.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -w -u -r1.9 -r1.10
--- Sleep.java 14 Apr 2002 11:16:13 -0000 1.9
+++ Sleep.java 15 Apr 2002 13:36:17 -0000 1.10
@@ -145,8 +145,7 @@
public void doSleep(long millis) {
try {
Thread.sleep(millis);
- }
- catch (InterruptedException ie) {
+ } catch (InterruptedException ie) {
}
}
@@ -201,12 +200,10 @@
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);
}
1.6 +1 -2
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/StreamPumper.java
Index: StreamPumper.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/StreamPumper.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -w -u -r1.5 -r1.6
--- StreamPumper.java 14 Apr 2002 11:16:13 -0000 1.5
+++ StreamPumper.java 15 Apr 2002 13:36:17 -0000 1.6
@@ -130,8 +130,7 @@
* @see #isFinished()
**/
public synchronized void waitFor()
- throws InterruptedException
- {
+ throws InterruptedException {
while (!isFinished()) {
wait();
}
1.29 +4 -8
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Tar.java
Index: Tar.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Tar.java,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -w -u -r1.28 -r1.29
--- Tar.java 14 Apr 2002 11:16:13 -0000 1.28
+++ Tar.java 15 Apr 2002 13:36:17 -0000 1.29
@@ -261,12 +261,10 @@
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 @@
try {
// close up
tOut.close();
- }
- catch (IOException e) {}
+ } catch (IOException e) {}
}
}
} finally {
@@ -307,8 +304,7 @@
protected void tarFile(File file, TarOutputStream tOut, String vPath,
TarFileSet tarFileSet)
- throws IOException
- {
+ throws IOException {
FileInputStream fIn = null;
String fullpath = tarFileSet.getFullpath();
1.25 +11 -22
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Tstamp.java
Index: Tstamp.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Tstamp.java,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -w -u -r1.24 -r1.25
--- Tstamp.java 14 Apr 2002 11:16:13 -0000 1.24
+++ Tstamp.java 15 Apr 2002 13:36:17 -0000 1.25
@@ -121,15 +121,13 @@
}
}
- 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 @@
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 @@
getLocation());
}
}
- }
- else {
+ } else {
country = "";
}
- }
- catch (NoSuchElementException e) {
+ } catch (NoSuchElementException e) {
throw new BuildException("bad locale format", e,
getLocation());
}
@@ -207,8 +199,7 @@
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 @@
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));
1.25 +1 -2
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Untar.java
Index: Untar.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Untar.java,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -w -u -r1.24 -r1.25
--- Untar.java 14 Apr 2002 11:16:13 -0000 1.24
+++ Untar.java 15 Apr 2002 13:36:17 -0000 1.25
@@ -97,8 +97,7 @@
if (tis != null) {
try {
tis.close();
- }
- catch (IOException e) {}
+ } catch (IOException e) {}
}
}
}
1.23 +2 -4
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/War.java
Index: War.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/War.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -w -u -r1.22 -r1.23
--- War.java 11 Apr 2002 12:29:43 -0000 1.22
+++ War.java 15 Apr 2002 13:36:17 -0000 1.23
@@ -128,8 +128,7 @@
}
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 @@
}
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
1.42 +2 -3
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java
Index: XSLTProcess.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -w -u -r1.41 -r1.42
--- XSLTProcess.java 14 Apr 2002 11:16:13 -0000 1.41
+++ XSLTProcess.java 15 Apr 2002 13:36:17 -0000 1.42
@@ -72,7 +72,7 @@
* A Task to process via XSLT a set of XML documents. This is
* useful for building views of XML based documentation.
*
- * @version $Revision: 1.41 $
+ * @version $Revision: 1.42 $
*
* @author <a href="mailto:[EMAIL PROTECTED]">Keith Visco</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Sam Ruby</a>
@@ -454,8 +454,7 @@
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);
1.76 +17 -39
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Zip.java
Index: Zip.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Zip.java,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -w -u -r1.75 -r1.76
--- Zip.java 15 Apr 2002 08:39:18 -0000 1.75
+++ Zip.java 15 Apr 2002 13:36:17 -0000 1.76
@@ -282,22 +282,18 @@
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 @@
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 @@
}
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 @@
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 @@
}
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 @@
* @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 @@
}
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 @@
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 @@
}
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);
1.10 +2 -4
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapterFactory.java
Index: CompilerAdapterFactory.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapterFactory.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -w -u -r1.9 -r1.10
--- CompilerAdapterFactory.java 14 Apr 2002 11:16:14 -0000 1.9
+++ CompilerAdapterFactory.java 15 Apr 2002 13:36:18 -0000 1.10
@@ -111,8 +111,7 @@
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 @@
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");
1.7 +2 -4
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/compilers/Javac12.java
Index: Javac12.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/compilers/Javac12.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -w -u -r1.6 -r1.7
--- Javac12.java 12 Apr 2002 14:46:45 -0000 1.6
+++ Javac12.java 15 Apr 2002 13:36:18 -0000 1.7
@@ -100,15 +100,13 @@
(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 {
1.8 +2 -4
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/compilers/Kjc.java
Index: Kjc.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/compilers/Kjc.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -w -u -r1.7 -r1.8
--- Kjc.java 12 Apr 2002 14:46:45 -0000 1.7
+++ Kjc.java 15 Apr 2002 13:36:18 -0000 1.8
@@ -88,15 +88,13 @@
(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 {
1.12 +4 -8
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/cvslib/ChangeLogParser.java
Index: ChangeLogParser.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/cvslib/ChangeLogParser.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -w -u -r1.11 -r1.12
--- ChangeLogParser.java 15 Apr 2002 12:20:51 -0000 1.11
+++ ChangeLogParser.java 15 Apr 2002 13:36:19 -0000 1.12
@@ -64,7 +64,7 @@
* A class used to parse the output of the CVS log command.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Peter Donald</a>
- * @version $Revision: 1.11 $ $Date: 2002/04/15 12:20:51 $
+ * @version $Revision: 1.12 $ $Date: 2002/04/15 13:36:19 $
*/
class ChangeLogParser {
//private static final int GET_ENTRY = 0;
@@ -147,14 +147,11 @@
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 @@
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;
1.8 +1 -2
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/EchoProperties.java
Index: EchoProperties.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/EchoProperties.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -w -u -r1.7 -r1.8
--- EchoProperties.java 14 Apr 2002 11:16:15 -0000 1.7
+++ EchoProperties.java 15 Apr 2002 13:36:19 -0000 1.8
@@ -275,8 +275,7 @@
[EMAIL PROTECTED] header prepend this header to the property output
*/
protected void jdk10SaveProperties(Properties props, OutputStream os,
- String header)
- {
+ String header) {
props.save(os, header);
}
}
1.11 +1 -7
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/Javah.java
Index: Javah.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/Javah.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -w -u -r1.10 -r1.11
--- Javah.java 15 Apr 2002 06:01:37 -0000 1.10
+++ Javah.java 15 Apr 2002 13:36:19 -0000 1.11
@@ -321,13 +321,7 @@
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 {
1.20 +57 -94
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/PropertyFile.java
Index: PropertyFile.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/PropertyFile.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -w -u -r1.19 -r1.20
--- PropertyFile.java 14 Apr 2002 11:16:15 -0000 1.19
+++ PropertyFile.java 15 Apr 2002 13:36:19 -0000 1.20
@@ -146,8 +146,7 @@
* @author Jeremy Mawson <a href="mailto:[EMAIL PROTECTED]">[EMAIL
PROTECTED]</a>
* @author Erik Hatcher <a href="mailto:[EMAIL PROTECTED]">[EMAIL
PROTECTED]</a>
*/
-public class PropertyFile extends Task
-{
+public class PropertyFile extends Task {
/*
========================================================================
*
@@ -180,38 +179,31 @@
* 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 @@
fis.close();
}
}
- }
- else
- {
+ } else {
log("Creating new property file: "
+ propertyfile.getAbsolutePath());
FileOutputStream out = null;
@@ -244,29 +234,23 @@
}
}
- 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 @@
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 @@
/*
* 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 @@
* 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 @@
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 @@
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 @@
* <code>null</code> if the <code>key</code> 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 @@
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 @@
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 @@
* <code>null</code> if the <code>key</code> 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 @@
: 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 @@
* <code>null</code> if the <code>key</code> 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 @@
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 @@
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 @@
if (value != null && defaultValue != null && oldValue ==
null) {
ret = defaultValue;
}
- }
- else {
+ } else {
ret = (oldValue == null) ? defaultValue : oldValue;
}
@@ -597,8 +562,7 @@
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 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;
1.7 +3 -6
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/Rpm.java
Index: Rpm.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/Rpm.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -w -u -r1.6 -r1.7
--- Rpm.java 15 Apr 2002 06:01:37 -0000 1.6
+++ Rpm.java 15 Apr 2002 13:36:19 -0000 1.7
@@ -145,16 +145,14 @@
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 @@
} catch (IOException e) {
throw new BuildException(e, location);
}
- }
- else {
+ } else {
errorstream = new LogOutputStream(this, Project.MSG_WARN);
}
streamhandler = new PumpStreamHandler(outputstream, errorstream);
1.14 +3 -6
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/XMLValidateTask.java
Index: XMLValidateTask.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/XMLValidateTask.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -w -u -r1.13 -r1.14
--- XMLValidateTask.java 15 Apr 2002 12:11:48 -0000 1.13
+++ XMLValidateTask.java 15 Apr 2002 13:36:19 -0000 1.14
@@ -254,8 +254,7 @@
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 @@
}
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 InputSource resolveEntity(String publicId, String systemId)
- throws SAXException
- {
+ throws SAXException {
File dtdFile = (File) fileDTDs.get(publicId);
if (dtdFile != null) {
try {
1.7 +1 -2
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ccm/CCMCreateTask.java
Index: CCMCreateTask.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ccm/CCMCreateTask.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -w -u -r1.6 -r1.7
--- CCMCreateTask.java 4 Mar 2002 08:49:35 -0000 1.6
+++ CCMCreateTask.java 15 Apr 2002 13:36:19 -0000 1.7
@@ -350,8 +350,7 @@
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
1.5 +1 -2
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/clearcase/ClearCase.java
Index: ClearCase.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/clearcase/ClearCase.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -w -u -r1.4 -r1.5
--- ClearCase.java 15 Apr 2002 06:01:37 -0000 1.4
+++ ClearCase.java 15 Apr 2002 13:36:19 -0000 1.5
@@ -133,8 +133,7 @@
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);
}
}
1.14 +8 -16
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/BorlandDeploymentTool.java
Index: BorlandDeploymentTool.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/BorlandDeploymentTool.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -w -u -r1.13 -r1.14
--- BorlandDeploymentTool.java 15 Apr 2002 06:01:37 -0000 1.13
+++ BorlandDeploymentTool.java 15 Apr 2002 13:36:19 -0000 1.14
@@ -231,8 +231,7 @@
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 @@
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 @@
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 @@
}
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 @@
+ 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 @@
* @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 @@
} // 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 @@
* @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) {
1.8 +5 -10
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/BorlandGenerateClient.java
Index: BorlandGenerateClient.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/BorlandGenerateClient.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -w -u -r1.7 -r1.8
--- BorlandGenerateClient.java 14 Apr 2002 11:16:17 -0000 1.7
+++ BorlandGenerateClient.java 15 Apr 2002 13:36:19 -0000 1.8
@@ -80,8 +80,7 @@
*
* @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 void setClasspath(Path classpath) {
if (this.classpath == null) {
this.classpath = classpath;
- }
- else {
+ } else {
this.classpath.append(classpath);
}
}
@@ -167,8 +165,7 @@
if (mode.equalsIgnoreCase(FORK_MODE)) {
executeFork();
- } // end of if ()
- else {
+ } else {
executeJava();
} // end of else
}
@@ -207,8 +204,7 @@
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 @@
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();
1.10 +2 -4
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/DDCreatorHelper.java
Index: DDCreatorHelper.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/DDCreatorHelper.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -w -u -r1.9 -r1.10
--- DDCreatorHelper.java 12 Apr 2002 13:26:51 -0000 1.9
+++ DDCreatorHelper.java 15 Apr 2002 13:36:19 -0000 1.10
@@ -125,8 +125,7 @@
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 @@
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(),
1.22 +11 -22
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/DescriptorHandler.java
Index: DescriptorHandler.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/DescriptorHandler.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -w -u -r1.21 -r1.22
--- DescriptorHandler.java 15 Apr 2002 06:01:37 -0000 1.21
+++ DescriptorHandler.java 15 Apr 2002 13:36:19 -0000 1.22
@@ -188,8 +188,7 @@
}
public InputSource resolveEntity(String publicId, String systemId)
- throws SAXException
- {
+ throws SAXException {
this.publicId = publicId;
File dtdFile = (File) fileDTDs.get(publicId);
@@ -273,20 +272,15 @@
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 @@
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;
}
}
1.16 +4 -8
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/EjbcHelper.java
Index: EjbcHelper.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/EjbcHelper.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -w -u -r1.15 -r1.16
--- EjbcHelper.java 14 Apr 2002 11:16:18 -0000 1.15
+++ EjbcHelper.java 15 Apr 2002 13:36:19 -0000 1.16
@@ -229,13 +229,11 @@
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 @@
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 @@
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);
1.8 +1 -2
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetEjbc.java
Index: IPlanetEjbc.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetEjbc.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -w -u -r1.7 -r1.8
--- IPlanetEjbc.java 14 Apr 2002 11:16:18 -0000 1.7
+++ IPlanetEjbc.java 15 Apr 2002 13:36:19 -0000 1.8
@@ -1208,8 +1208,7 @@
return -1;
}
latestModified = Math.max(latestModified, modified);
- }
- else {
+ } else {
pkFile = null;
}
1.6 +1 -2
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetEjbcTask.java
Index: IPlanetEjbcTask.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetEjbcTask.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -w -u -r1.5 -r1.6
--- IPlanetEjbcTask.java 4 Mar 2002 08:49:35 -0000 1.5
+++ IPlanetEjbcTask.java 15 Apr 2002 13:36:19 -0000 1.6
@@ -293,8 +293,7 @@
} 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);
}
1.12 +1 -2
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicTOPLinkDeploymentTool.java
Index: WeblogicTOPLinkDeploymentTool.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicTOPLinkDeploymentTool.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -w -u -r1.11 -r1.12
--- WeblogicTOPLinkDeploymentTool.java 15 Apr 2002 06:01:37 -0000
1.11
+++ WeblogicTOPLinkDeploymentTool.java 15 Apr 2002 13:36:19 -0000
1.12
@@ -114,8 +114,7 @@
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);
}
1.9 +1 -2
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJAntTool.java
Index: VAJAntTool.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJAntTool.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -w -u -r1.8 -r1.9
--- VAJAntTool.java 14 Apr 2002 11:16:18 -0000 1.8
+++ VAJAntTool.java 15 Apr 2002 13:36:19 -0000 1.9
@@ -117,8 +117,7 @@
if (args.length >= 2 && args[1] instanceof String) {
String projectName = (String) args[1];
info = loadBuildData(projectName);
- }
- else {
+ } else {
info = new VAJBuildInfo();
}
1.13 +8 -16
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJAntToolGUI.java
Index: VAJAntToolGUI.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJAntToolGUI.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -w -u -r1.12 -r1.13
--- VAJAntToolGUI.java 14 Apr 2002 11:16:18 -0000 1.12
+++ VAJAntToolGUI.java 15 Apr 2002 13:36:20 -0000 1.13
@@ -209,8 +209,7 @@
if (error == null) {
getMessageTextArea().append(lineSeparator + "BUILD
SUCCESSFUL");
- }
- else {
+ } else {
logException(error);
}
@@ -232,8 +231,7 @@
if (nested != null) {
nested.printStackTrace(System.err);
}
- }
- else {
+ } else {
error.printStackTrace(System.err);
}
}
@@ -339,8 +337,7 @@
try {
getBuildInfo().updateTargetList();
fillList();
- }
- catch (Throwable fileNotFound) {
+ } catch (Throwable fileNotFound) {
handleException(fileNotFound);
getTargetList().removeAll();
getBuildButton().setEnabled(false);
@@ -370,8 +367,7 @@
if (e.getSource() ==
VAJAntToolGUI.this.getMessageOkButton()) {
getMessageFrame().dispose();
}
- }
- catch (Throwable exc) {
+ } catch (Throwable exc) {
handleException(exc);
}
}
@@ -390,8 +386,7 @@
if (e.getSource() == VAJAntToolGUI.this.getTargetList()) {
getBuildInfo().setTarget(getTargetList().getSelectedItem());
}
- }
- catch (Throwable exc) {
+ } catch (Throwable exc) {
handleException(exc);
}
}
@@ -432,8 +427,7 @@
if (e.getSource() == VAJAntToolGUI.this.getMessageFrame()) {
getMessageFrame().dispose();
}
- }
- catch (Throwable exc) {
+ } catch (Throwable exc) {
handleException(exc);
}
}
@@ -524,8 +518,7 @@
try {
getMessageFrame().show();
getBuildInfo().executeProject(logger);
- }
- catch (Throwable exc) {
+ } catch (Throwable exc) {
logger.logException(exc);
}
return;
@@ -1346,8 +1339,7 @@
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);
}
1.8 +3 -6
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJLocalUtil.java
Index: VAJLocalUtil.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJLocalUtil.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -w -u -r1.7 -r1.8
--- VAJLocalUtil.java 15 Apr 2002 06:01:37 -0000 1.7
+++ VAJLocalUtil.java 15 Apr 2002 13:36:20 -0000 1.8
@@ -350,8 +350,7 @@
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 @@
* @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()];
1.4 +1 -2
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/AbstractHotDeploymentTool.java
Index: AbstractHotDeploymentTool.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/AbstractHotDeploymentTool.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -u -r1.3 -r1.4
--- AbstractHotDeploymentTool.java 14 Apr 2002 11:16:19 -0000 1.3
+++ AbstractHotDeploymentTool.java 15 Apr 2002 13:36:20 -0000 1.4
@@ -80,8 +80,7 @@
* @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;
1.5 +1 -2
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/GenericHotDeploymentTool.java
Index: GenericHotDeploymentTool.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/GenericHotDeploymentTool.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -w -u -r1.4 -r1.5
--- GenericHotDeploymentTool.java 14 Apr 2002 11:16:19 -0000 1.4
+++ GenericHotDeploymentTool.java 15 Apr 2002 13:36:20 -0000 1.5
@@ -69,8 +69,7 @@
* @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;
1.3 +1 -2
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/HotDeploymentTool.java
Index: HotDeploymentTool.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/HotDeploymentTool.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -u -r1.2 -r1.3
--- HotDeploymentTool.java 10 Apr 2002 00:19:54 -0000 1.2
+++ HotDeploymentTool.java 15 Apr 2002 13:36:20 -0000 1.3
@@ -63,8 +63,7 @@
* @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";
1.4 +2 -4
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/JonasHotDeploymentTool.java
Index: JonasHotDeploymentTool.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/JonasHotDeploymentTool.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -u -r1.3 -r1.4
--- JonasHotDeploymentTool.java 12 Apr 2002 13:26:52 -0000 1.3
+++ JonasHotDeploymentTool.java 15 Apr 2002 13:36:20 -0000 1.4
@@ -241,11 +241,9 @@
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");
}
}
1.5 +1 -2
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/ServerDeploy.java
Index: ServerDeploy.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/ServerDeploy.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -w -u -r1.4 -r1.5
--- ServerDeploy.java 15 Apr 2002 12:22:31 -0000 1.4
+++ ServerDeploy.java 15 Apr 2002 13:36:20 -0000 1.5
@@ -74,8 +74,7 @@
* @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;
1.4 +1 -2
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/WebLogicHotDeploymentTool.java
Index: WebLogicHotDeploymentTool.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/WebLogicHotDeploymentTool.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -u -r1.3 -r1.4
--- WebLogicHotDeploymentTool.java 14 Apr 2002 11:16:19 -0000 1.3
+++ WebLogicHotDeploymentTool.java 15 Apr 2002 13:36:20 -0000 1.4
@@ -96,8 +96,7 @@
* 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);
1.11 +1 -2
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JJTree.java
Index: JJTree.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JJTree.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -w -u -r1.10 -r1.11
--- JJTree.java 14 Apr 2002 11:16:19 -0000 1.10
+++ JJTree.java 15 Apr 2002 13:36:20 -0000 1.11
@@ -219,8 +219,7 @@
if (process.execute() != 0) {
throw new BuildException("JJTree failed.");
}
- }
- catch (IOException e) {
+ } catch (IOException e) {
throw new BuildException("Failed to launch JJTree", e);
}
}
1.15 +3 -6
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JavaCC.java
Index: JavaCC.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JavaCC.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -w -u -r1.14 -r1.15
--- JavaCC.java 14 Apr 2002 11:16:19 -0000 1.14
+++ JavaCC.java 15 Apr 2002 13:36:20 -0000 1.15
@@ -224,8 +224,7 @@
// 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 @@
* 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 @@
int startExtn = path.lastIndexOf('.');
if (startExtn != -1) {
path = path.substring(0, startExtn) + ".java";
- }
- else {
+ } else {
path += ".java";
}
1.10 +5 -10
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTask.java
Index: JDependTask.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTask.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -w -u -r1.9 -r1.10
--- JDependTask.java 14 Apr 2002 11:16:19 -0000 1.9
+++ JDependTask.java 15 Apr 2002 13:36:20 -0000 1.10
@@ -228,17 +228,14 @@
}
- 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 @@
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 @@
}
try {
jdepend.addDirectory(f.getPath());
- }
- catch (IOException e) {
+ } catch (IOException e) {
String msg = "JDepend Failed when adding a source directory:
"
+ e.getMessage();
log(msg);
1.7 +1 -2
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/jlink/ClassNameReader.java
Index: ClassNameReader.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/jlink/ClassNameReader.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -w -u -r1.6 -r1.7
--- ClassNameReader.java 15 Apr 2002 06:01:37 -0000 1.6
+++ ClassNameReader.java 15 Apr 2002 13:36:20 -0000 1.7
@@ -86,8 +86,7 @@
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;
1.8 +2 -4
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/jlink/JlinkTask.java
Index: JlinkTask.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/jlink/JlinkTask.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -w -u -r1.7 -r1.8
--- JlinkTask.java 15 Apr 2002 12:11:48 -0000 1.7
+++ JlinkTask.java 15 Apr 2002 13:36:20 -0000 1.8
@@ -112,8 +112,7 @@
public void setMergefiles(Path mergefiles) {
if (this.mergefiles == null) {
this.mergefiles = mergefiles;
- }
- else {
+ } else {
this.mergefiles.append(mergefiles);
}
}
@@ -135,8 +134,7 @@
public void setAddfiles(Path addfiles) {
if (this.addfiles == null) {
this.addfiles = addfiles;
- }
- else {
+ } else {
this.addfiles.append(addfiles);
}
}
1.15 +9 -18
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/jsp/JspC.java
Index: JspC.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/jsp/JspC.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -w -u -r1.14 -r1.15
--- JspC.java 15 Apr 2002 12:11:48 -0000 1.14
+++ JspC.java 15 Apr 2002 13:36:20 -0000 1.15
@@ -110,8 +110,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">J D Glanville</a>
* @since 1.5
*/
-public class JspC extends MatchingTask
-{
+public class JspC extends MatchingTask {
/* ------------------------------------------------------------ */
private Path classpath;
private Path src;
@@ -226,23 +225,19 @@
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 @@
//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 @@
+ 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 @@
if (!compiler.execute()) {
if (failOnError) {
throw new BuildException(FAIL_MSG, location);
- }
- else {
+ } else {
log(FAIL_MSG, Project.MSG_ERR);
}
}
1.6 +3 -6
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/jsp/JspNameMangler.java
Index: JspNameMangler.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/jsp/JspNameMangler.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -w -u -r1.5 -r1.6
--- JspNameMangler.java 12 Apr 2002 13:26:52 -0000 1.5
+++ JspNameMangler.java 15 Apr 2002 13:36:20 -0000 1.6
@@ -121,8 +121,7 @@
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 @@
char subChar = className.charAt(i);
if (Character.isJavaIdentifierPart(subChar)) {
modifiedClassName.append(subChar);
- }
- else {
+ } else {
modifiedClassName.append(mangleChar(subChar));
}
}
@@ -150,8 +148,7 @@
String filename = jspFile.getName();
if (filename.endsWith(".jsp")) {
className = filename.substring(0, filename.length() - 4);
- }
- else {
+ } else {
className = filename;
}
return className;
1.8 +1 -2
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/jsp/WLJspc.java
Index: WLJspc.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/jsp/WLJspc.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -w -u -r1.7 -r1.8
--- WLJspc.java 15 Apr 2002 12:11:48 -0000 1.7
+++ WLJspc.java 15 Apr 2002 13:36:20 -0000 1.8
@@ -113,8 +113,7 @@
*
*/
-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
1.3 +1 -2
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/DefaultJspCompilerAdapter.java
Index: DefaultJspCompilerAdapter.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/DefaultJspCompilerAdapter.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -u -r1.2 -r1.3
--- DefaultJspCompilerAdapter.java 15 Apr 2002 12:11:48 -0000 1.2
+++ DefaultJspCompilerAdapter.java 15 Apr 2002 13:36:21 -0000 1.3
@@ -83,8 +83,7 @@
*/
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");
1.8 +4 -8
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/JasperC.java
Index: JasperC.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/JasperC.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -w -u -r1.7 -r1.8
--- JasperC.java 15 Apr 2002 12:11:48 -0000 1.7
+++ JasperC.java 15 Apr 2002 13:36:21 -0000 1.8
@@ -73,8 +73,7 @@
* @author steve loughran
* @since ant1.5
*/
-public class JasperC extends DefaultJspCompilerAdapter
-{
+public class JasperC extends DefaultJspCompilerAdapter {
/**
* our execute method
*/
@@ -90,8 +89,7 @@
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 @@
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 @@
throw new BuildException("Error running jsp compiler: ",
ex, getJspc().getLocation());
}
- }
- finally {
+ } finally {
getJspc().deleteEmptyJavaFiles();
}
}
1.22 +1 -2
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLJUnitResultFormatter.java
Index: XMLJUnitResultFormatter.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLJUnitResultFormatter.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -w -u -r1.21 -r1.22
--- XMLJUnitResultFormatter.java 15 Apr 2002 12:11:48 -0000 1.21
+++ XMLJUnitResultFormatter.java 15 Apr 2002 13:36:21 -0000 1.22
@@ -91,8 +91,7 @@
private static DocumentBuilder getDocumentBuilder() {
try {
return DocumentBuilderFactory.newInstance().newDocumentBuilder();
- }
- catch (Exception exc) {
+ } catch (Exception exc) {
throw new ExceptionInInitializerError(exc);
}
}
1.9 +2 -4
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/net/MimeMail.java
Index: MimeMail.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/net/MimeMail.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -w -u -r1.8 -r1.9
--- MimeMail.java 15 Apr 2002 12:11:49 -0000 1.8
+++ MimeMail.java 15 Apr 2002 13:36:21 -0000 1.9
@@ -69,16 +69,14 @@
* @author [EMAIL PROTECTED] Erik Hatcher
* @author [EMAIL PROTECTED] 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();
1.12 +80 -110
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/net/TelnetTask.java
Index: TelnetTask.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/net/TelnetTask.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -w -u -r1.11 -r1.12
--- TelnetTask.java 15 Apr 2002 12:11:49 -0000 1.11
+++ TelnetTask.java 15 Apr 2002 13:36:21 -0000 1.12
@@ -70,7 +70,7 @@
* Class to provide automated telnet protocol support for the Ant build tool
*
* @author <a href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</a>
- * @version $Revision: 1.11 $
+ * @version $Revision: 1.12 $
*/
public class TelnetTask extends Task {
@@ -120,8 +120,7 @@
* 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 @@
}
/** 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 @@
* 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 @@
/**
* 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 @@
* 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 @@
* 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 @@
* 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 @@
* 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 @@
/**
* 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,26 +268,22 @@
* 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;
}
@@ -311,15 +294,13 @@
* Currently it is a wrapper around <a href="www.oroinc.com">ORO</a>'s
* NetComponents
*/
- public class AntTelnetClient extends TelnetClient
- {
+ 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)
- {
+ public void waitForString(String s) {
waitForString(s, null);
}
@@ -329,24 +310,18 @@
* @param s The string to wait on
* @param timeout The maximum number of seconds to wait
*/
- public void waitForString(String s, Integer timeout)
- {
+ 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)
- {
+ if (timeout == null || timeout.intValue() == 0) {
+ while (sb.toString().indexOf(s) == -1){
sb.append((char) is.read());
}
- }
- else
- {
+ } else {
Calendar endTime = Calendar.getInstance();
endTime.add(Calendar.SECOND, timeout.intValue());
- while (sb.toString().indexOf(s) == -1)
- {
+ while (sb.toString().indexOf(s) == -1) {
while (Calendar.getInstance().before(endTime) &&
is.available() == 0) {
Thread.sleep(250);
@@ -358,22 +333,18 @@
}
}
log(sb.toString(), Project.MSG_INFO);
- } catch (BuildException be)
- {
+ } catch (BuildException be) {
throw be;
- } catch (Exception e)
- {
+ } 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)
- {
+ public void sendString(String s, boolean echoString) {
OutputStream os = this.getOutputStream();
try {
os.write((s + "\n").getBytes());
@@ -381,8 +352,7 @@
log(s, Project.MSG_INFO);
}
os.flush();
- } catch (Exception e)
- {
+ } catch (Exception e) {
throw new BuildException(e, getLocation());
}
}
1.12 +1 -2
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/pvcs/Pvcs.java
Index: Pvcs.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/pvcs/Pvcs.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -w -u -r1.11 -r1.12
--- Pvcs.java 15 Apr 2002 12:11:49 -0000 1.11
+++ Pvcs.java 15 Apr 2002 13:36:21 -0000 1.12
@@ -131,8 +131,7 @@
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);
1.9 +8 -15
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/sound/AntSoundPlayer.java
Index: AntSoundPlayer.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/sound/AntSoundPlayer.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -w -u -r1.8 -r1.9
--- AntSoundPlayer.java 15 Apr 2002 12:11:49 -0000 1.8
+++ AntSoundPlayer.java 15 Apr 2002 13:36:21 -0000 1.9
@@ -87,7 +87,7 @@
* I have only tested this with .WAV and .AIFF sound file formats. Both seem
to work fine.
*
* @author Nick Pellow
- * @version $Revision: 1.8 $, $Date: 2002/04/15 12:11:49 $
+ * @version $Revision: 1.9 $, $Date: 2002/04/15 13:36:21 $
*/
public class AntSoundPlayer implements LineListener, BuildListener {
@@ -139,12 +139,10 @@
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 @@
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 @@
}
audioClip.drain();
audioClip.close();
- }
- else {
+ } else {
project.log("Can't get data from file " + file.getName());
}
}
@@ -189,8 +184,7 @@
clip.loop(Clip.LOOP_CONTINUOUSLY);
try {
Thread.sleep(duration);
- }
- catch (InterruptedException e) {
+ } catch (InterruptedException e) {
}
}
@@ -202,8 +196,7 @@
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.
1.10 +1 -2
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSLABEL.java
Index: MSVSSLABEL.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSLABEL.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -w -u -r1.9 -r1.10
--- MSVSSLABEL.java 15 Apr 2002 12:11:49 -0000 1.9
+++ MSVSSLABEL.java 15 Apr 2002 13:36:21 -0000 1.10
@@ -111,8 +111,7 @@
*
* @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;
1.12 +7 -14
jakarta-ant/src/main/org/apache/tools/ant/types/FilterSet.java
Index: FilterSet.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/types/FilterSet.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -w -u -r1.11 -r1.12
--- FilterSet.java 15 Apr 2002 12:11:50 -0000 1.11
+++ FilterSet.java 15 Apr 2002 13:36:21 -0000 1.12
@@ -306,22 +306,18 @@
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 @@
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 @@
b.append(line.substring(i));
return b.toString();
- }
- catch (StringIndexOutOfBoundsException e) {
+ } catch (StringIndexOutOfBoundsException e) {
return line;
}
- }
- else {
+ } else {
return line;
}
}
1.35 +3 -6 jakarta-ant/src/main/org/apache/tools/ant/types/Path.java
Index: Path.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/types/Path.java,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -w -u -r1.34 -r1.35
--- Path.java 15 Apr 2002 12:11:50 -0000 1.34
+++ Path.java 15 Apr 2002 13:36:21 -0000 1.35
@@ -260,8 +260,7 @@
File f = null;
if (getProject() != null) {
f = getProject().resolveFile(list[i]);
- }
- else {
+ } else {
f = new File(list[i]);
}
@@ -384,8 +383,7 @@
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 @@
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"
1.24 +1 -2
jakarta-ant/src/main/org/apache/tools/ant/types/PatternSet.java
Index: PatternSet.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/types/PatternSet.java,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -w -u -r1.23 -r1.24
--- PatternSet.java 15 Apr 2002 12:11:50 -0000 1.23
+++ PatternSet.java 15 Apr 2002 13:36:21 -0000 1.24
@@ -470,8 +470,7 @@
}
}
- public String toString()
- {
+ public String toString() {
return "patternSet{ includes: " + includeList +
" excludes: " + excludeList + " }";
}
1.10 +9 -20
jakarta-ant/src/main/org/apache/tools/ant/types/RegularExpression.java
Index: RegularExpression.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/types/RegularExpression.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -w -u -r1.9 -r1.10
--- RegularExpression.java 15 Apr 2002 12:11:50 -0000 1.9
+++ RegularExpression.java 15 Apr 2002 13:36:21 -0000 1.10
@@ -96,8 +96,7 @@
*
* @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 @@
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 @@
* 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 @@
return regexp.getPattern();
}
- public Regexp getRegexp(Project p)
- {
+ public Regexp getRegexp(Project p) {
if (isReference()) {
return getRef(p).getRegexp(p);
}
@@ -140,10 +135,8 @@
* 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 @@
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;
}
}
-
}
1.9 +8 -18
jakarta-ant/src/main/org/apache/tools/ant/types/Substitution.java
Index: Substitution.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/types/Substitution.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -w -u -r1.8 -r1.9
--- Substitution.java 12 Apr 2002 13:26:53 -0000 1.8
+++ Substitution.java 15 Apr 2002 13:36:21 -0000 1.9
@@ -70,19 +70,16 @@
* @see org.apache.oro.text.regex.Perl5Substitution
* @author Matthew Inger <a href="mailto:[EMAIL PROTECTED]">[EMAIL
PROTECTED]</a>
*/
-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 @@
* 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 @@
* 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 @@
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;
}
}
-
}
1.23 +2 -3
jakarta-ant/src/main/org/apache/tools/ant/util/FileUtils.java
Index: FileUtils.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/util/FileUtils.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -w -u -r1.22 -r1.23
--- FileUtils.java 15 Apr 2002 12:11:51 -0000 1.22
+++ FileUtils.java 15 Apr 2002 13:36:21 -0000 1.23
@@ -95,7 +95,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Magesh Umasankar</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Jeff Tulley</a>
*
- * @version $Revision: 1.22 $
+ * @version $Revision: 1.23 $
*/
public class FileUtils {
@@ -153,8 +153,7 @@
* @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);
}
1.8 +6 -13
jakarta-ant/src/main/org/apache/tools/ant/util/regexp/JakartaOroMatcher.java
Index: JakartaOroMatcher.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/util/regexp/JakartaOroMatcher.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -w -u -r1.7 -r1.8
--- JakartaOroMatcher.java 15 Apr 2002 12:11:51 -0000 1.7
+++ JakartaOroMatcher.java 15 Apr 2002 13:36:21 -0000 1.8
@@ -96,16 +96,12 @@
* 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 @@
* 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 @@
* parenthesized subexpressions</p>.
*/
public Vector getGroups(String input, int options)
- throws BuildException
- {
+ throws BuildException {
if (!matches(input, options)) {
return null;
}
@@ -158,8 +152,7 @@
return v;
}
- protected int getCompilerOptions(int options)
- {
+ protected int getCompilerOptions(int options) {
int cOptions = Perl5Compiler.DEFAULT_MASK;
if (RegexpUtil.hasFlag(options, MATCH_CASE_INSENSITIVE)) {
1.7 +4 -8
jakarta-ant/src/main/org/apache/tools/ant/util/regexp/JakartaOroRegexp.java
Index: JakartaOroRegexp.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/util/regexp/JakartaOroRegexp.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -w -u -r1.6 -r1.7
--- JakartaOroRegexp.java 15 Apr 2002 12:11:51 -0000 1.6
+++ JakartaOroRegexp.java 15 Apr 2002 13:36:21 -0000 1.7
@@ -64,17 +64,14 @@
* Regular expression implementation using the Jakarta Oro package
* @author Matthew Inger <a href="mailto:[EMAIL PROTECTED]">[EMAIL
PROTECTED]</a>
*/
-public class JakartaOroRegexp extends JakartaOroMatcher implements Regexp
-{
+public class JakartaOroRegexp extends JakartaOroMatcher implements Regexp {
- public JakartaOroRegexp()
- {
+ public JakartaOroRegexp() {
super();
}
public String substitute(String input, String argument, int options)
- throws BuildException
- {
+ throws BuildException {
// translate \1 to $1 so that the Perl5Substitution will work
StringBuffer subst = new StringBuffer();
for (int i = 0; i < argument.length(); i++) {
@@ -109,8 +106,7 @@
getSubsOptions(options));
}
- protected int getSubsOptions(int options)
- {
+ protected int getSubsOptions(int options) {
boolean replaceAll = RegexpUtil.hasFlag(options, REPLACE_ALL);
int subsOptions = 1;
if (replaceAll) {
1.10 +6 -13
jakarta-ant/src/main/org/apache/tools/ant/util/regexp/JakartaRegexpMatcher.java
Index: JakartaRegexpMatcher.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/util/regexp/JakartaRegexpMatcher.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -w -u -r1.9 -r1.10
--- JakartaRegexpMatcher.java 15 Apr 2002 12:11:51 -0000 1.9
+++ JakartaRegexpMatcher.java 15 Apr 2002 13:36:21 -0000 1.10
@@ -85,17 +85,13 @@
}
protected RE getCompiledPattern(int options)
- throws BuildException
- {
+ throws BuildException {
int cOptions = getCompilerOptions(options);
- try
- {
+ try {
RE reg = new RE(pattern);
reg.setMatchFlags(cOptions);
return reg;
- }
- catch (RESyntaxException e)
- {
+ } catch (RESyntaxException e) {
throw new BuildException(e);
}
}
@@ -111,8 +107,7 @@
* Does the given argument match the pattern?
*/
public boolean matches(String input, int options)
- throws BuildException
- {
+ throws BuildException {
return matches(input, getCompiledPattern(options));
}
@@ -131,8 +126,7 @@
}
public Vector getGroups(String input, int options)
- throws BuildException
- {
+ throws BuildException {
RE reg = getCompiledPattern(options);
if (!matches(input, reg)) {
return null;
@@ -145,8 +139,7 @@
return v;
}
- protected int getCompilerOptions(int options)
- {
+ protected int getCompilerOptions(int options) {
int cOptions = RE.MATCH_NORMAL;
if (RegexpUtil.hasFlag(options, MATCH_CASE_INSENSITIVE)) {
1.8 +5 -8
jakarta-ant/src/main/org/apache/tools/ant/util/regexp/JakartaRegexpRegexp.java
Index: JakartaRegexpRegexp.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/util/regexp/JakartaRegexpRegexp.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -w -u -r1.7 -r1.8
--- JakartaRegexpRegexp.java 15 Apr 2002 12:11:51 -0000 1.7
+++ JakartaRegexpRegexp.java 15 Apr 2002 13:36:21 -0000 1.8
@@ -62,16 +62,14 @@
* Regular expression implementation using the Jakarta Regexp package
* @author Matthew Inger <a href="mailto:[EMAIL PROTECTED]">[EMAIL
PROTECTED]</a>
*/
-public class JakartaRegexpRegexp extends JakartaRegexpMatcher implements
Regexp
-{
+public class JakartaRegexpRegexp extends JakartaRegexpMatcher
+ implements Regexp {
- public JakartaRegexpRegexp()
- {
+ public JakartaRegexpRegexp() {
super();
}
- protected int getSubsOptions(int options)
- {
+ protected int getSubsOptions(int options) {
int subsOptions = RE.REPLACE_FIRSTONLY;
if (RegexpUtil.hasFlag(options, REPLACE_ALL)) {
subsOptions = RE.REPLACE_ALL;
@@ -80,8 +78,7 @@
}
public String substitute(String input, String argument, int options)
- throws BuildException
- {
+ throws BuildException {
Vector v = getGroups(input, options);
// replace \1 with the corresponding group
1.9 +8 -18
jakarta-ant/src/main/org/apache/tools/ant/util/regexp/Jdk14RegexpMatcher.java
Index: Jdk14RegexpMatcher.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/util/regexp/Jdk14RegexpMatcher.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -w -u -r1.8 -r1.9
--- Jdk14RegexpMatcher.java 15 Apr 2002 12:11:51 -0000 1.8
+++ Jdk14RegexpMatcher.java 15 Apr 2002 13:36:21 -0000 1.9
@@ -89,16 +89,12 @@
}
protected Pattern getCompiledPattern(int options)
- throws BuildException
- {
+ throws BuildException {
int cOptions = getCompilerOptions(options);
- try
- {
+ try {
Pattern p = Pattern.compile(this.pattern, cOptions);
return p;
- }
- catch (PatternSyntaxException e)
- {
+ } catch (PatternSyntaxException e) {
throw new BuildException(e);
}
}
@@ -114,15 +110,11 @@
* Does the given argument match the pattern?
*/
public boolean matches(String input, int options)
- throws BuildException
- {
- try
- {
+ throws BuildException {
+ try {
Pattern p = getCompiledPattern(options);
return p.matcher(input).find();
- }
- catch (Exception e)
- {
+ } catch (Exception e) {
throw new BuildException(e);
}
}
@@ -144,8 +136,7 @@
* parenthesized subexpressions</p>.
*/
public Vector getGroups(String input, int options)
- throws BuildException
- {
+ throws BuildException {
Pattern p = getCompiledPattern(options);
Matcher matcher = p.matcher(input);
if (!matcher.find()) {
@@ -159,8 +150,7 @@
return v;
}
- protected int getCompilerOptions(int options)
- {
+ protected int getCompilerOptions(int options) {
// be strict about line separator
int cOptions = Pattern.UNIX_LINES;
1.9 +6 -13
jakarta-ant/src/main/org/apache/tools/ant/util/regexp/Jdk14RegexpRegexp.java
Index: Jdk14RegexpRegexp.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/util/regexp/Jdk14RegexpRegexp.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -w -u -r1.8 -r1.9
--- Jdk14RegexpRegexp.java 15 Apr 2002 12:11:51 -0000 1.8
+++ Jdk14RegexpRegexp.java 15 Apr 2002 13:36:21 -0000 1.9
@@ -64,16 +64,13 @@
* Regular expression implementation using the JDK 1.4 regular expression
package
* @author Matthew Inger <a href="mailto:[EMAIL PROTECTED]">[EMAIL
PROTECTED]</a>
*/
-public class Jdk14RegexpRegexp extends Jdk14RegexpMatcher implements Regexp
-{
+public class Jdk14RegexpRegexp extends Jdk14RegexpMatcher implements Regexp {
- public Jdk14RegexpRegexp()
- {
+ public Jdk14RegexpRegexp() {
super();
}
- protected int getSubsOptions(int options)
- {
+ protected int getSubsOptions(int options) {
int subsOptions = REPLACE_FIRST;
if (RegexpUtil.hasFlag(options, REPLACE_ALL)) {
subsOptions = REPLACE_ALL;
@@ -82,8 +79,7 @@
}
public String substitute(String input, String argument, int options)
- throws BuildException
- {
+ throws BuildException {
// translate \1 to $(1) so that the Matcher will work
StringBuffer subst = new StringBuffer();
for (int i = 0; i < argument.length(); i++) {
@@ -112,12 +108,9 @@
StringBuffer sb = new StringBuffer();
Matcher m = p.matcher(input);
- if (RegexpUtil.hasFlag(sOptions, REPLACE_ALL))
- {
+ if (RegexpUtil.hasFlag(sOptions, REPLACE_ALL)) {
sb.append(m.replaceAll(argument));
- }
- else
- {
+ } else {
boolean res = m.find();
if (res) {
m.appendReplacement(sb, argument);
1.5 +1 -2
jakarta-ant/src/main/org/apache/tools/ant/util/regexp/Regexp.java
Index: Regexp.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/util/regexp/Regexp.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -w -u -r1.4 -r1.5
--- Regexp.java 12 Apr 2002 13:44:36 -0000 1.4
+++ Regexp.java 15 Apr 2002 13:36:22 -0000 1.5
@@ -61,8 +61,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Matthew Inger</a>
*/
-public interface Regexp extends RegexpMatcher
-{
+public interface Regexp extends RegexpMatcher {
/**
* Replace only the first occurance of the regular expression
1.8 +3 -5
jakarta-ant/src/main/org/apache/tools/ant/util/regexp/RegexpFactory.java
Index: RegexpFactory.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/util/regexp/RegexpFactory.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -w -u -r1.7 -r1.8
--- RegexpFactory.java 12 Apr 2002 13:26:54 -0000 1.7
+++ RegexpFactory.java 15 Apr 2002 13:36:22 -0000 1.8
@@ -62,12 +62,10 @@
* <code>ant.regexp.regexpimpl</code>.
*
* @author Matthew Inger <a href="mailto:[EMAIL PROTECTED]">[EMAIL
PROTECTED]</a>
- * @version $Revision: 1.7 $
+ * @version $Revision: 1.8 $
*/
-public class RegexpFactory extends RegexpMatcherFactory
-{
- public RegexpFactory()
- {
+public class RegexpFactory extends RegexpMatcherFactory {
+ public RegexpFactory() {
}
/***
1.4 +3 -6
jakarta-ant/src/main/org/apache/tools/ant/util/regexp/RegexpUtil.java
Index: RegexpUtil.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/util/regexp/RegexpUtil.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -u -r1.3 -r1.4
--- RegexpUtil.java 12 Apr 2002 13:44:36 -0000 1.3
+++ RegexpUtil.java 15 Apr 2002 13:36:22 -0000 1.4
@@ -58,15 +58,12 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Matthew Inger</a>
*/
-public class RegexpUtil extends Object
-{
- public static final boolean hasFlag(int options, int flag)
- {
+public class RegexpUtil {
+ public static final boolean hasFlag(int options, int flag) {
return ((options & flag) > 0);
}
- public static final int removeFlag(int options, int flag)
- {
+ public static final int removeFlag(int options, int flag) {
return (options & (0xFFFFFFFF - flag));
}
}
1.11 +2 -4
jakarta-ant/src/main/org/apache/tools/bzip2/CBZip2OutputStream.java
Index: CBZip2OutputStream.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/bzip2/CBZip2OutputStream.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -w -u -r1.10 -r1.11
--- CBZip2OutputStream.java 15 Apr 2002 12:11:51 -0000 1.10
+++ CBZip2OutputStream.java 15 Apr 2002 13:36:22 -0000 1.11
@@ -560,8 +560,7 @@
int ch = (bsBuff >> 24);
try {
bsStream.write(ch); // write 8-bit
- }
- catch (IOException e) {
+ } catch (IOException e) {
throw e;
}
bsBuff <<= 8;
@@ -575,8 +574,7 @@
int ch = (bsBuff >> 24);
try {
bsStream.write(ch); // write 8-bit
- }
- catch (IOException e) {
+ } catch (IOException e) {
throw e;
}
bsBuff <<= 8;
1.10 +5 -10
jakarta-ant/src/main/org/apache/tools/mail/MailMessage.java
Index: MailMessage.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/mail/MailMessage.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -w -u -r1.9 -r1.10
--- MailMessage.java 12 Apr 2002 13:26:54 -0000 1.9
+++ MailMessage.java 15 Apr 2002 13:36:22 -0000 1.10
@@ -337,17 +337,14 @@
if (start == 0) {
end = i; // support "address (name)"
}
- }
- else if (c == ')') {
+ } else if (c == ')') {
paramDepth--;
if (end == 0) {
start = i + 1; // support "(name) address"
}
- }
- else if (paramDepth == 0 && c == '<') {
+ } else if (paramDepth == 0 && c == '<') {
start = i + 1;
- }
- else if (paramDepth == 0 && c == '>') {
+ } else if (paramDepth == 0 && c == '>') {
end = i;
}
}
@@ -469,12 +466,10 @@
if (b == '\n' && lastChar != '\r') {
rawWrite('\r'); // ensure always \r\n
rawWrite(b);
- }
- else if (b == '.' && lastChar == '\n') {
+ } else if (b == '.' && lastChar == '\n') {
rawWrite('.'); // add extra dot
rawWrite(b);
- }
- else {
+ } else {
rawWrite(b);
}
lastChar = b;
1.12 +1 -2 jakarta-ant/src/main/org/apache/tools/tar/TarEntry.java
Index: TarEntry.java
===================================================================
RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/tar/TarEntry.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -w -u -r1.11 -r1.12
--- TarEntry.java 15 Apr 2002 12:11:52 -0000 1.11
+++ TarEntry.java 15 Apr 2002 13:36:22 -0000 1.12
@@ -220,8 +220,7 @@
name = name.substring(2);
}
}
- }
- else if (osname.toLowerCase().indexOf("netware") > -1) {
+ } else if (osname.toLowerCase().indexOf("netware") > -1) {
int colon = name.indexOf(':');
if (colon != -1) {
name = name.substring(colon + 1);
1.7 +2 -3
jakarta-ant/src/main/org/apache/tools/tar/TarOutputStream.java
Index: TarOutputStream.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/tar/TarOutputStream.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -w -u -r1.6 -r1.7
--- TarOutputStream.java 10 Jan 2002 10:40:48 -0000 1.6
+++ TarOutputStream.java 15 Apr 2002 13:36:22 -0000 1.7
@@ -1,7 +1,7 @@
/*
* The Apache Software License, Version 1.1
*
- * Copyright (c) 2000-2001 The Apache Software Foundation. All rights
+ * Copyright (c) 2000-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -179,8 +179,7 @@
write(entry.getName().getBytes());
write(0);
closeEntry();
- }
- else if (longFileMode != LONGFILE_TRUNCATE) {
+ } else if (longFileMode != LONGFILE_TRUNCATE) {
throw new RuntimeException("file name '" + entry.getName()
+ "' is too long ( > "
+ TarConstants.NAMELEN + "
bytes)");
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>