Browse Source

Fix up style issues

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@272409 13f79535-47bb-0310-9956-ffa450edef68
master
Conor MacNeill 23 years ago
parent
commit
0e1127c22c
20 changed files with 213 additions and 190 deletions
  1. +23
    -8
      src/main/org/apache/tools/ant/IntrospectionHelper.java
  2. +49
    -49
      src/main/org/apache/tools/ant/taskdefs/AbstractCvsTask.java
  3. +24
    -18
      src/main/org/apache/tools/ant/taskdefs/Ant.java
  4. +7
    -8
      src/main/org/apache/tools/ant/taskdefs/AntStructure.java
  5. +7
    -6
      src/main/org/apache/tools/ant/taskdefs/Available.java
  6. +3
    -3
      src/main/org/apache/tools/ant/taskdefs/BUnzip2.java
  7. +26
    -26
      src/main/org/apache/tools/ant/taskdefs/CVSPass.java
  8. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/CallTarget.java
  9. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/Checksum.java
  10. +15
    -13
      src/main/org/apache/tools/ant/taskdefs/Copy.java
  11. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/Copydir.java
  12. +28
    -28
      src/main/org/apache/tools/ant/taskdefs/Definer.java
  13. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapter.java
  14. +15
    -15
      src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapterFactory.java
  15. +5
    -5
      src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java
  16. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/compilers/Gcj.java
  17. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/compilers/Javac12.java
  18. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/compilers/Jikes.java
  19. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/compilers/Jvc.java
  20. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/compilers/Kjc.java

+ 23
- 8
src/main/org/apache/tools/ant/IntrospectionHelper.java View File

@@ -212,14 +212,7 @@ public class IntrospectionHelper implements BuildListener {


// not really user settable properties on tasks // not really user settable properties on tasks
if (org.apache.tools.ant.Task.class.isAssignableFrom(bean) if (org.apache.tools.ant.Task.class.isAssignableFrom(bean)
&& args.length == 1 &&
(
(
"setLocation".equals(name) && org.apache.tools.ant.Location.class.equals(args[0])
) || (
"setTaskType".equals(name) && java.lang.String.class.equals(args[0])
)
)) {
&& args.length == 1 && isHiddenSetMethod(name, args[0])) {
continue; continue;
} }


@@ -353,6 +346,28 @@ public class IntrospectionHelper implements BuildListener {
} }
} }


/**
* Certain set methods are part of the Ant core interface to tasks and
* therefore not to be considered for introspection
*
* @param name the name of the set method
* @param type the type of the set method's parameter
* @return true if the given set method is to be hidden.
*/
private boolean isHiddenSetMethod(String name, Class type) {
if ("setLocation".equals(name)
&& org.apache.tools.ant.Location.class.equals(type)) {
return true;
}
if ("setTaskType".equals(name)
&& java.lang.String.class.equals(type)) {
return true;
}
return false;
}
/** /**
* Returns a helper for the given class, either from the cache * Returns a helper for the given class, either from the cache
* or by creating a new instance. * or by creating a new instance.


+ 49
- 49
src/main/org/apache/tools/ant/taskdefs/AbstractCvsTask.java View File

@@ -186,8 +186,7 @@ public abstract class AbstractCvsTask extends Task {


protected ExecuteStreamHandler getExecuteStreamHandler(){ protected ExecuteStreamHandler getExecuteStreamHandler(){


if(this.executeStreamHandler == null){

if (this.executeStreamHandler == null) {
setExecuteStreamHandler(new PumpStreamHandler(getOutputStream(), setExecuteStreamHandler(new PumpStreamHandler(getOutputStream(),
getErrorStream())); getErrorStream()));
} }
@@ -203,7 +202,7 @@ public abstract class AbstractCvsTask extends Task {


protected OutputStream getOutputStream(){ protected OutputStream getOutputStream(){


if(this.outputStream == null){
if (this.outputStream == null) {


if (output != null) { if (output != null) {
try { try {
@@ -230,7 +229,7 @@ public abstract class AbstractCvsTask extends Task {


protected OutputStream getErrorStream(){ protected OutputStream getErrorStream(){


if(this.errorStream == null){
if (this.errorStream == null) {


if (error != null) { if (error != null) {


@@ -254,7 +253,7 @@ public abstract class AbstractCvsTask extends Task {
* Sets up the environment for toExecute and then runs it. * Sets up the environment for toExecute and then runs it.
* @throws BuildException * @throws BuildException
*/ */
protected void runCommand( Commandline toExecute ) throws BuildException {
protected void runCommand(Commandline toExecute) throws BuildException {
// XXX: we should use JCVS (www.ice.com/JCVS) instead of // XXX: we should use JCVS (www.ice.com/JCVS) instead of
// command line execution so that we don't rely on having // command line execution so that we don't rely on having
// native CVS stuff around (SM) // native CVS stuff around (SM)
@@ -264,7 +263,7 @@ public abstract class AbstractCvsTask extends Task {


Environment env = new Environment(); Environment env = new Environment();


if (port>0) {
if (port > 0) {
Environment.Variable var = new Environment.Variable(); Environment.Variable var = new Environment.Variable();
var.setKey("CVS_CLIENT_PORT"); var.setKey("CVS_CLIENT_PORT");
var.setValue(String.valueOf(port)); var.setValue(String.valueOf(port));
@@ -286,7 +285,7 @@ public abstract class AbstractCvsTask extends Task {
} }
*/ */


if (passFile!=null) {
if (passFile != null) {
Environment.Variable var = new Environment.Variable(); Environment.Variable var = new Environment.Variable();
var.setKey("CVS_PASSFILE"); var.setKey("CVS_PASSFILE");
var.setValue(String.valueOf(passFile)); var.setValue(String.valueOf(passFile));
@@ -295,7 +294,7 @@ public abstract class AbstractCvsTask extends Task {
Project.MSG_INFO); Project.MSG_INFO);
} }


if (cvsRsh!=null) {
if (cvsRsh != null) {
Environment.Variable var = new Environment.Variable(); Environment.Variable var = new Environment.Variable();
var.setKey("CVS_RSH"); var.setKey("CVS_RSH");
var.setValue(String.valueOf(cvsRsh)); var.setValue(String.valueOf(cvsRsh));
@@ -322,42 +321,42 @@ public abstract class AbstractCvsTask extends Task {
log("running cvs command: " + actualCommandLine, log("running cvs command: " + actualCommandLine,
Project.MSG_DEBUG); Project.MSG_DEBUG);
int retCode = exe.execute(); int retCode = exe.execute();
log( "retCode="+retCode, Project.MSG_DEBUG );
log("retCode=" + retCode, Project.MSG_DEBUG);
/*Throw an exception if cvs exited with error. (Iulian)*/ /*Throw an exception if cvs exited with error. (Iulian)*/
if(failOnError && retCode != 0) {
if (failOnError && retCode != 0) {
throw new BuildException("cvs exited with error code " throw new BuildException("cvs exited with error code "
+ retCode + retCode
+ StringUtils.LINE_SEP + StringUtils.LINE_SEP
+ "Command line was [" + "Command line was ["
+ actualCommandLine + "]", location );
+ actualCommandLine + "]", location);
} }
} }
catch (IOException e) { catch (IOException e) {
if( failOnError ) {
if (failOnError) {
throw new BuildException(e, location); throw new BuildException(e, location);
} }
else { else {
log("Caught exception: "+e.getMessage(), Project.MSG_WARN);
log("Caught exception: " + e.getMessage(), Project.MSG_WARN);
} }
} }
catch (BuildException e) { catch (BuildException e) {
if( failOnError ) {
throw( e );
if (failOnError) {
throw(e);
} }
else { else {
Throwable t = e.getException(); Throwable t = e.getException();
if (t == null) { if (t == null) {
t = e; t = e;
} }
log("Caught exception: "+t.getMessage(), Project.MSG_WARN);
log("Caught exception: " + t.getMessage(), Project.MSG_WARN);
} }
} }
catch (Exception e) { catch (Exception e) {
if( failOnError ) {
if (failOnError) {
throw new BuildException(e, location); throw new BuildException(e, location);
} }
else { else {
log("Caught exception: "+e.getMessage(), Project.MSG_WARN);
log("Caught exception: " + e.getMessage(), Project.MSG_WARN);
} }
} }
finally { finally {
@@ -382,23 +381,22 @@ public abstract class AbstractCvsTask extends Task {


String savedCommand = getCommand(); String savedCommand = getCommand();


if( this.getCommand() == null
&& vecCommandlines.size() == 0 ) {
if (this.getCommand() == null && vecCommandlines.size() == 0) {
// re-implement legacy behaviour: // re-implement legacy behaviour:
this.setCommand( AbstractCvsTask.default_command );
this.setCommand(AbstractCvsTask.default_command);
} }


String c = this.getCommand(); String c = this.getCommand();
Commandline cloned = null; Commandline cloned = null;
if( c != null ) {
if (c != null) {
cloned = (Commandline) cmd.clone(); cloned = (Commandline) cmd.clone();
cloned.createArgument(true).setLine(c); cloned.createArgument(true).setLine(c);
this.addConfiguredCommandline(cloned, true); this.addConfiguredCommandline(cloned, true);
} }


try { try {
for( int i = 0; i < vecCommandlines.size(); i++ ) {
this.runCommand( (Commandline)vecCommandlines.elementAt( i ) );
for (int i = 0; i < vecCommandlines.size(); i++) {
this.runCommand((Commandline) vecCommandlines.elementAt(i));
} }
} finally { } finally {
if (cloned != null) { if (cloned != null) {
@@ -412,7 +410,7 @@ public abstract class AbstractCvsTask extends Task {


StringBuffer stringBuffer = new StringBuffer(250); StringBuffer stringBuffer = new StringBuffer(250);
String[] commandLine = execute.getCommandline(); String[] commandLine = execute.getCommandline();
for(int i=0; i<commandLine.length; i++){
for (int i = 0; i < commandLine.length; i++){


stringBuffer.append(commandLine[i]); stringBuffer.append(commandLine[i]);
stringBuffer.append(" "); stringBuffer.append(" ");
@@ -421,12 +419,12 @@ public abstract class AbstractCvsTask extends Task {
String newLine = StringUtils.LINE_SEP; String newLine = StringUtils.LINE_SEP;
String[] variableArray = execute.getEnvironment(); String[] variableArray = execute.getEnvironment();


if(variableArray != null){
if (variableArray != null) {
stringBuffer.append(newLine); stringBuffer.append(newLine);
stringBuffer.append(newLine); stringBuffer.append(newLine);
stringBuffer.append("environment:"); stringBuffer.append("environment:");
stringBuffer.append(newLine); stringBuffer.append(newLine);
for(int z=0; z<variableArray.length; z++){
for (int z = 0; z < variableArray.length; z++){
stringBuffer.append(newLine); stringBuffer.append(newLine);
stringBuffer.append("\t"); stringBuffer.append("\t");
stringBuffer.append(variableArray[z]); stringBuffer.append(variableArray[z]);
@@ -518,7 +516,7 @@ public abstract class AbstractCvsTask extends Task {
* of commands externally. * of commands externally.
*/ */
public void addCommandArgument(String arg){ public void addCommandArgument(String arg){
this.addCommandArgument( cmd, arg);
this.addCommandArgument(cmd, arg);
} }


public void addCommandArgument(Commandline c, String arg){ public void addCommandArgument(Commandline c, String arg){
@@ -527,7 +525,7 @@ public abstract class AbstractCvsTask extends Task {




public void setDate(String p) { public void setDate(String p) {
if(p != null && p.trim().length() > 0) {
if (p != null && p.trim().length() > 0) {
addCommandArgument("-D"); addCommandArgument("-D");
addCommandArgument(p); addCommandArgument(p);
} }
@@ -567,16 +565,16 @@ public abstract class AbstractCvsTask extends Task {
/** /**
* Configure a commandline element for things like cvsRoot, quiet, etc. * Configure a commandline element for things like cvsRoot, quiet, etc.
*/ */
protected void configureCommandline( Commandline c ) {
if( c == null ) {
protected void configureCommandline(Commandline c) {
if (c == null) {
return; return;
} }
c.setExecutable( "cvs" );
c.setExecutable("cvs");
if (cvsPackage != null) { if (cvsPackage != null) {
c.createArgument().setLine(cvsPackage); c.createArgument().setLine(cvsPackage);
} }
if ( this.compression > 0 && this.compression < 10 ) {
c.createArgument(true).setValue("-z"+this.compression);
if (this.compression > 0 && this.compression < 10) {
c.createArgument(true).setValue("-z" + this.compression);
} }
if (quiet) { if (quiet) {
c.createArgument(true).setValue("-q"); c.createArgument(true).setValue("-q");
@@ -585,31 +583,33 @@ public abstract class AbstractCvsTask extends Task {
c.createArgument(true).setValue("-n"); c.createArgument(true).setValue("-n");
} }
if (cvsRoot != null) { if (cvsRoot != null) {
c.createArgument(true).setLine("-d"+cvsRoot);
c.createArgument(true).setLine("-d" + cvsRoot);
} }
} }


protected void removeCommandline(Commandline c) { protected void removeCommandline(Commandline c) {
vecCommandlines.removeElement( c );
vecCommandlines.removeElement(c);
} }


public void addConfiguredCommandline( Commandline c ) {
this.addConfiguredCommandline( c, false );
public void addConfiguredCommandline(Commandline c) {
this.addConfiguredCommandline(c, false);
} }


/** /**
* Configures and adds the given Commandline. * Configures and adds the given Commandline.
* @param insertAtStart If true, c is * @param insertAtStart If true, c is
*/ */
public void addConfiguredCommandline( Commandline c,
boolean insertAtStart ) {
if( c == null ) { return; }
this.configureCommandline( c );
if( insertAtStart ) {
vecCommandlines.insertElementAt( c, 0 );
public void addConfiguredCommandline(Commandline c,
boolean insertAtStart) {
if (c == null) {
return;
}
this.configureCommandline(c);
if (insertAtStart) {
vecCommandlines.insertElementAt(c, 0);
} }
else { else {
vecCommandlines.addElement( c );
vecCommandlines.addElement(c);
} }
} }


@@ -617,7 +617,7 @@ public abstract class AbstractCvsTask extends Task {
* If set to a value 1-9 it adds -zN to the cvs command line, else * If set to a value 1-9 it adds -zN to the cvs command line, else
* it disables compression. * it disables compression.
*/ */
public void setCompressionLevel( int level ) {
public void setCompressionLevel(int level) {
this.compression = level; this.compression = level;
} }


@@ -625,9 +625,9 @@ public abstract class AbstractCvsTask extends Task {
* @param usecomp If true, turns on compression using default * @param usecomp If true, turns on compression using default
* level, AbstractCvsTask.DEFAULT_COMPRESSION_LEVEL. * level, AbstractCvsTask.DEFAULT_COMPRESSION_LEVEL.
*/ */
public void setCompression( boolean usecomp ) {
setCompressionLevel( usecomp ?
AbstractCvsTask.DEFAULT_COMPRESSION_LEVEL : 0 );
public void setCompression(boolean usecomp) {
setCompressionLevel(usecomp ?
AbstractCvsTask.DEFAULT_COMPRESSION_LEVEL : 0);
} }


} }

+ 24
- 18
src/main/org/apache/tools/ant/taskdefs/Ant.java View File

@@ -199,7 +199,7 @@ public class Ant extends Task {
Vector listeners = project.getBuildListeners(); Vector listeners = project.getBuildListeners();
final int count = listeners.size(); final int count = listeners.size();
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
newProject.addBuildListener((BuildListener)listeners.elementAt(i));
newProject.addBuildListener((BuildListener) listeners.elementAt(i));
} }


if (output != null) { if (output != null) {
@@ -217,8 +217,8 @@ public class Ant extends Task {
logger.setErrorPrintStream(out); logger.setErrorPrintStream(out);
newProject.addBuildListener(logger); newProject.addBuildListener(logger);
} }
catch( IOException ex ) {
log( "Ant: Can't set output to " + output );
catch (IOException ex) {
log("Ant: Can't set output to " + output);
} }
} }


@@ -309,7 +309,7 @@ public class Ant extends Task {
reinit(); reinit();
} }


if ( (dir == null) && (inheritAll) ) {
if ((dir == null) && (inheritAll)) {
dir = project.getBaseDir(); dir = project.getBaseDir();
} }


@@ -331,10 +331,10 @@ public class Ant extends Task {
File file = FileUtils.newFileUtils().resolveFile(dir, antFile); File file = FileUtils.newFileUtils().resolveFile(dir, antFile);
antFile = file.getAbsolutePath(); antFile = file.getAbsolutePath();


log("calling target "+(target!=null?target:"[default]")
+ " in build file "+ antFile.toString(),
log("calling target " + (target != null ? target : "[default]")
+ " in build file " + antFile.toString(),
Project.MSG_VERBOSE); Project.MSG_VERBOSE);
newProject.setUserProperty( "ant.file" , antFile );
newProject.setUserProperty("ant.file" , antFile);
ProjectHelper.configureProject(newProject, new File(antFile)); ProjectHelper.configureProject(newProject, new File(antFile));


if (target == null) { if (target == null) {
@@ -393,8 +393,8 @@ public class Ant extends Task {
Hashtable newReferences = newProject.getReferences(); Hashtable newReferences = newProject.getReferences();
Enumeration e; Enumeration e;
if (references.size() > 0) { if (references.size() > 0) {
for(e = references.elements(); e.hasMoreElements();) {
Reference ref = (Reference)e.nextElement();
for (e = references.elements(); e.hasMoreElements();) {
Reference ref = (Reference) e.nextElement();
String refid = ref.getRefId(); String refid = ref.getRefId();
if (refid == null) { if (refid == null) {
throw new BuildException("the refid attribute is required" throw new BuildException("the refid attribute is required"
@@ -419,8 +419,8 @@ public class Ant extends Task {
// Now add all references that are not defined in the // Now add all references that are not defined in the
// subproject, if inheritRefs is true // subproject, if inheritRefs is true
if (inheritRefs) { if (inheritRefs) {
for(e = thisReferences.keys(); e.hasMoreElements();) {
String key = (String)e.nextElement();
for (e = thisReferences.keys(); e.hasMoreElements();) {
String key = (String) e.nextElement();
if (newReferences.containsKey(key)) { if (newReferences.containsKey(key)) {
continue; continue;
} }
@@ -456,14 +456,14 @@ public class Ant extends Task {
} else { } else {
try { try {
Method setProjectM = Method setProjectM =
c.getMethod( "setProject", new Class[] {Project.class});
if(setProjectM != null) {
c.getMethod("setProject", new Class[] {Project.class});
if (setProjectM != null) {
setProjectM.invoke(copy, new Object[] {newProject}); setProjectM.invoke(copy, new Object[] {newProject});
} }
} catch (NoSuchMethodException e) { } catch (NoSuchMethodException e) {
// ignore this if the class being referenced does not have // ignore this if the class being referenced does not have
// a set project method. // a set project method.
} catch(Exception e2) {
} catch (Exception e2) {
String msg = "Error setting new project instance for " String msg = "Error setting new project instance for "
+ "reference with id " + oldKey; + "reference with id " + oldKey;
throw new BuildException(msg, e2, location); throw new BuildException(msg, e2, location);
@@ -516,7 +516,7 @@ public class Ant extends Task {
Property p = new Property(true); Property p = new Property(true);
p.setProject(newProject); p.setProject(newProject);
p.setTaskName("property"); p.setTaskName("property");
properties.addElement( p );
properties.addElement(p);
return p; return p;
} }


@@ -537,8 +537,14 @@ public class Ant extends Task {


public Reference() {super();} public Reference() {super();}


private String targetid=null;
public void setToRefid(String targetid) { this.targetid=targetid; }
public String getToRefid() { return targetid; }
private String targetid = null;

public void setToRefid(String targetid) {
this.targetid = targetid;
}

public String getToRefid() {
return targetid;
}
} }
} }

+ 7
- 8
src/main/org/apache/tools/ant/taskdefs/AntStructure.java View File

@@ -145,8 +145,8 @@ public class AntStructure extends Task {
printTail(out); printTail(out);


} catch (IOException ioe) { } catch (IOException ioe) {
throw new BuildException("Error writing "+output.getAbsolutePath(),
ioe, location);
throw new BuildException("Error writing "
+ output.getAbsolutePath(), ioe, location);
} finally { } finally {
if (out != null) { if (out != null) {
out.close(); out.close();
@@ -314,7 +314,7 @@ public class AntStructure extends Task {
} else if (org.apache.tools.ant.types.EnumeratedAttribute.class.isAssignableFrom(type)) { } else if (org.apache.tools.ant.types.EnumeratedAttribute.class.isAssignableFrom(type)) {
try { try {
EnumeratedAttribute ea = EnumeratedAttribute ea =
(EnumeratedAttribute)type.newInstance();
(EnumeratedAttribute) type.newInstance();
String[] values = ea.getValues(); String[] values = ea.getValues();
if (values == null if (values == null
|| values.length == 0 || values.length == 0
@@ -322,7 +322,7 @@ public class AntStructure extends Task {
sb.append("CDATA "); sb.append("CDATA ");
} else { } else {
sb.append("("); sb.append("(");
for (int i=0; i < values.length; i++) {
for (int i = 0; i < values.length; i++) {
if (i != 0) { if (i != 0) {
sb.append(" | "); sb.append(" | ");
} }
@@ -346,10 +346,9 @@ public class AntStructure extends Task {
final int count = v.size(); final int count = v.size();
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
String nestedName = (String) v.elementAt(i); String nestedName = (String) v.elementAt(i);
if (!"#PCDATA".equals(nestedName) &&
!TASKS.equals(nestedName) &&
!TYPES.equals(nestedName)
) {
if (!"#PCDATA".equals(nestedName)
&& !TASKS.equals(nestedName)
&& !TYPES.equals(nestedName)) {
printElementDecl(out, nestedName, ih.getElementType(nestedName)); printElementDecl(out, nestedName, ih.getElementType(nestedName));
} }
} }


+ 7
- 6
src/main/org/apache/tools/ant/taskdefs/Available.java View File

@@ -264,7 +264,7 @@ public class Available extends Task implements Condition {
return checkFile(project.resolveFile(file), file); return checkFile(project.resolveFile(file), file);
} else { } else {
String[] paths = filepath.list(); String[] paths = filepath.list();
for(int i = 0; i < paths.length; ++i) {
for (int i = 0; i < paths.length; ++i) {
log("Searching " + paths[i], Project.MSG_DEBUG); log("Searching " + paths[i], Project.MSG_DEBUG);
File path = new File(paths[i]); File path = new File(paths[i]);


@@ -340,12 +340,12 @@ public class Available extends Task implements Condition {
private boolean checkFile(File f, String text) { private boolean checkFile(File f, String text) {
if (type != null) { if (type != null) {
if (type.isDir()) { if (type.isDir()) {
if( f.isDirectory()) {
if (f.isDirectory()) {
log("Found directory: " + text, Project.MSG_VERBOSE); log("Found directory: " + text, Project.MSG_VERBOSE);
} }
return f.isDirectory(); return f.isDirectory();
} else if (type.isFile()) { } else if (type.isFile()) {
if( f.isFile()) {
if (f.isFile()) {
log("Found file: " + text, Project.MSG_VERBOSE); log("Found file: " + text, Project.MSG_VERBOSE);
} }
return f.isFile(); return f.isFile();
@@ -380,12 +380,13 @@ public class Available extends Task implements Condition {
private boolean checkClass(String classname) { private boolean checkClass(String classname) {
try { try {
Class requiredClass = null; Class requiredClass = null;
if( ignoreSystemclasses ) {
loader = new AntClassLoader(null,getProject(),classpath,false);
if (ignoreSystemclasses) {
loader = new AntClassLoader(null, getProject(),
classpath, false);
if (loader != null) { if (loader != null) {
try { try {
loader.findClass(classname); loader.findClass(classname);
} catch( SecurityException se ) {
} catch (SecurityException se) {
// class found but restricted name; this is actually // class found but restricted name; this is actually
// the case we're looking for, so catch the exception // the case we're looking for, so catch the exception
// and return // and return


+ 3
- 3
src/main/org/apache/tools/ant/taskdefs/BUnzip2.java View File

@@ -84,7 +84,7 @@ public class BUnzip2 extends Unpack {


protected void extract() { protected void extract() {
if (source.lastModified() > dest.lastModified()) { if (source.lastModified() > dest.lastModified()) {
log("Expanding "+ source.getAbsolutePath() + " to "
log("Expanding " + source.getAbsolutePath() + " to "
+ dest.getAbsolutePath()); + dest.getAbsolutePath());


FileOutputStream out = null; FileOutputStream out = null;
@@ -96,11 +96,11 @@ public class BUnzip2 extends Unpack {
fis = new FileInputStream(source); fis = new FileInputStream(source);
bis = new BufferedInputStream(fis); bis = new BufferedInputStream(fis);
int b = bis.read(); int b = bis.read();
if(b != 'B') {
if (b != 'B') {
throw new BuildException("Invalid bz2 file.", location); throw new BuildException("Invalid bz2 file.", location);
} }
b = bis.read(); b = bis.read();
if(b != 'Z') {
if (b != 'Z') {
throw new BuildException("Invalid bz2 file.", location); throw new BuildException("Invalid bz2 file.", location);
} }
zIn = new CBZip2InputStream(bis); zIn = new CBZip2InputStream(bis);


+ 26
- 26
src/main/org/apache/tools/ant/taskdefs/CVSPass.java View File

@@ -88,26 +88,26 @@ public class CVSPass extends Task {


/** Array contain char conversion data */ /** Array contain char conversion data */
private final char[] shifts = { private final char[] shifts = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
114,120, 53, 79, 96,109, 72,108, 70, 64, 76, 67,116, 74, 68, 87,
111, 52, 75,119, 49, 34, 82, 81, 95, 65,112, 86,118,110,122,105,
41, 57, 83, 43, 46,102, 40, 89, 38,103, 45, 50, 42,123, 91, 35,
125, 55, 54, 66,124,126, 59, 47, 92, 71,115, 78, 88,107,106, 56,
36,121,117,104,101,100, 69, 73, 99, 63, 94, 93, 39, 37, 61, 48,
58,113, 32, 90, 44, 98, 60, 51, 33, 97, 62, 77, 84, 80, 85,223,
225,216,187,166,229,189,222,188,141,249,148,200,184,136,248,190,
199,170,181,204,138,232,218,183,255,234,220,247,213,203,226,193,
174,172,228,252,217,201,131,230,197,211,145,238,161,179,160,212,
207,221,254,173,202,146,224,151,140,196,205,130,135,133,143,246,
192,159,244,239,185,168,215,144,139,165,180,157,147,186,214,176,
227,231,219,169,175,156,206,198,129,164,150,210,154,177,134,127,
182,128,158,208,162,132,167,209,149,241,153,251,237,236,171,195,
243,233,253,240,194,250,191,155,142,137,245,235,163,242,178,152
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
114, 120, 53, 79, 96, 109, 72, 108, 70, 64, 76, 67, 116, 74, 68, 87,
111, 52, 75, 119, 49, 34, 82, 81, 95, 65, 112, 86, 118, 110, 122, 105,
41, 57, 83, 43, 46, 102, 40, 89, 38, 103, 45, 50, 42, 123, 91, 35,
125, 55, 54, 66, 124, 126, 59, 47, 92, 71, 115, 78, 88, 107, 106, 56,
36, 121, 117, 104, 101, 100, 69, 73, 99, 63, 94, 93, 39, 37, 61, 48,
58, 113, 32, 90, 44, 98, 60, 51, 33, 97, 62, 77, 84, 80, 85, 223,
225, 216, 187, 166, 229, 189, 222, 188, 141, 249, 148, 200, 184, 136, 248, 190,
199, 170, 181, 204, 138, 232, 218, 183, 255, 234, 220, 247, 213, 203, 226, 193,
174, 172, 228, 252, 217, 201, 131, 230, 197, 211, 145, 238, 161, 179, 160, 212,
207, 221, 254, 173, 202, 146, 224, 151, 140, 196, 205, 130, 135, 133, 143, 246,
192, 159, 244, 239, 185, 168, 215, 144, 139, 165, 180, 157, 147, 186, 214, 176,
227, 231, 219, 169, 175, 156, 206, 198, 129, 164, 150, 210, 154, 177, 134, 127,
182, 128, 158, 208, 162, 132, 167, 209, 149, 241, 153, 251, 237, 236, 171, 195,
243, 233, 253, 240, 194, 250, 191, 155, 142, 137, 245, 235, 163, 242, 178, 152
}; };


public CVSPass(){ public CVSPass(){
passFile = new File(System.getProperty("user.home")+"/.cvspass");
passFile = new File(System.getProperty("user.home") + "/.cvspass");
} }


/** /**
@@ -116,10 +116,10 @@ public class CVSPass extends Task {
* @exception BuildException if someting goes wrong with the build * @exception BuildException if someting goes wrong with the build
*/ */
public final void execute() throws BuildException { public final void execute() throws BuildException {
if(cvsRoot==null) {
if (cvsRoot == null) {
throw new BuildException("cvsroot is required"); throw new BuildException("cvsroot is required");
} }
if(password==null) {
if (password == null) {
throw new BuildException("password is required"); throw new BuildException("password is required");
} }


@@ -129,16 +129,16 @@ public class CVSPass extends Task {


BufferedReader reader = null; BufferedReader reader = null;
PrintWriter writer = null; PrintWriter writer = null;
try{
try {
StringBuffer buf = new StringBuffer(); StringBuffer buf = new StringBuffer();


if(passFile.exists()){
if (passFile.exists()) {
reader = new BufferedReader(new FileReader(passFile)); reader = new BufferedReader(new FileReader(passFile));


String line = null; String line = null;


while((line=reader.readLine())!=null){
if(!line.startsWith(cvsRoot)){
while ((line = reader.readLine()) != null) {
if (!line.startsWith(cvsRoot)) {
buf.append(line).append(StringUtils.LINE_SEP); buf.append(line).append(StringUtils.LINE_SEP);
} }
} }
@@ -151,8 +151,8 @@ public class CVSPass extends Task {


writer = new PrintWriter(new FileWriter(passFile)); writer = new PrintWriter(new FileWriter(passFile));


writer.println( pwdfile );
}catch(IOException e){
writer.println(pwdfile);
} catch (IOException e) {
throw new BuildException(e); throw new BuildException(e);
} finally { } finally {
if (reader != null) { if (reader != null) {
@@ -168,7 +168,7 @@ public class CVSPass extends Task {


private final String mangle(String password){ private final String mangle(String password){
StringBuffer buf = new StringBuffer(); StringBuffer buf = new StringBuffer();
for(int i=0;i<password.length();i++) {
for (int i = 0; i < password.length(); i++) {
buf.append(shifts[password.charAt(i)]); buf.append(shifts[password.charAt(i)]);
} }
return buf.toString(); return buf.toString();


+ 1
- 1
src/main/org/apache/tools/ant/taskdefs/CallTarget.java View File

@@ -106,7 +106,7 @@ public class CallTarget extends Task {
* @param inheritRefs new value * @param inheritRefs new value
*/ */
public void setInheritRefs(boolean inheritRefs) { public void setInheritRefs(boolean inheritRefs) {
this.inheritRefs=inheritRefs;
this.inheritRefs = inheritRefs;
} }


/** /**


+ 1
- 1
src/main/org/apache/tools/ant/taskdefs/Checksum.java View File

@@ -360,7 +360,7 @@ public class Checksum extends MatchingTask implements Condition {
messageDigest.reset(); messageDigest.reset();
File src = (File) e.nextElement(); File src = (File) e.nextElement();
if (!isCondition) { if (!isCondition) {
log("Calculating "+algorithm+" checksum for "+src);
log("Calculating " + algorithm + " checksum for " + src);
} }
fis = new FileInputStream(src); fis = new FileInputStream(src);
DigestInputStream dis = new DigestInputStream(fis, DigestInputStream dis = new DigestInputStream(fis,


+ 15
- 13
src/main/org/apache/tools/ant/taskdefs/Copy.java View File

@@ -124,7 +124,9 @@ public class Copy extends Task {
fileUtils = FileUtils.newFileUtils(); fileUtils = FileUtils.newFileUtils();
} }


protected FileUtils getFileUtils() {return fileUtils;}
protected FileUtils getFileUtils() {
return fileUtils;
}


/** /**
* Sets a single source file to copy. * Sets a single source file to copy.
@@ -258,7 +260,7 @@ public class Copy extends Task {
* @param failonerror true or false * @param failonerror true or false
*/ */
public void setFailOnError(boolean failonerror) { public void setFailOnError(boolean failonerror) {
this.failonerror=failonerror;
this.failonerror = failonerror;
} }


/** /**
@@ -334,7 +336,7 @@ public class Copy extends Task {
} else { } else {
String message = "Warning: Could not find file " String message = "Warning: Could not find file "
+ file.getAbsolutePath() + " to copy."; + file.getAbsolutePath() + " to copy.";
if(!failonerror) {
if (!failonerror) {
log(message); log(message);
} else { } else {
throw new BuildException(message); throw new BuildException(message);
@@ -343,7 +345,7 @@ public class Copy extends Task {
} }


// deal with the filesets // deal with the filesets
for (int i=0; i<filesets.size(); i++) {
for (int i = 0; i < filesets.size(); i++) {
FileSet fs = (FileSet) filesets.elementAt(i); FileSet fs = (FileSet) filesets.elementAt(i);
DirectoryScanner ds = fs.getDirectoryScanner(project); DirectoryScanner ds = fs.getDirectoryScanner(project);
File fromDir = fs.getDir(project); File fromDir = fs.getDir(project);
@@ -465,7 +467,7 @@ public class Copy extends Task {
String[] toCopy = null; String[] toCopy = null;
if (forceOverwrite) { if (forceOverwrite) {
Vector v = new Vector(); Vector v = new Vector();
for (int i=0; i<names.length; i++) {
for (int i = 0; i < names.length; i++) {
if (mapper.mapFileName(names[i]) != null) { if (mapper.mapFileName(names[i]) != null) {
v.addElement(names[i]); v.addElement(names[i]);
} }
@@ -480,7 +482,7 @@ public class Copy extends Task {
for (int i = 0; i < toCopy.length; i++) { for (int i = 0; i < toCopy.length; i++) {
File src = new File(fromDir, toCopy[i]); File src = new File(fromDir, toCopy[i]);
File dest = new File(toDir, mapper.mapFileName(toCopy[i])[0]); File dest = new File(toDir, mapper.mapFileName(toCopy[i])[0]);
map.put( src.getAbsolutePath(), dest.getAbsolutePath() );
map.put(src.getAbsolutePath(), dest.getAbsolutePath());
} }
} }


@@ -490,16 +492,16 @@ public class Copy extends Task {
*/ */
protected void doFileOperations() { protected void doFileOperations() {
if (fileCopyMap.size() > 0) { if (fileCopyMap.size() > 0) {
log("Copying " + fileCopyMap.size() +
" file" + (fileCopyMap.size() == 1 ? "" : "s") +
" to " + destDir.getAbsolutePath() );
log("Copying " + fileCopyMap.size()
+ " file" + (fileCopyMap.size() == 1 ? "" : "s")
+ " to " + destDir.getAbsolutePath());


Enumeration e = fileCopyMap.keys(); Enumeration e = fileCopyMap.keys();
while (e.hasMoreElements()) { while (e.hasMoreElements()) {
String fromFile = (String) e.nextElement(); String fromFile = (String) e.nextElement();
String toFile = (String) fileCopyMap.get(fromFile); String toFile = (String) fileCopyMap.get(fromFile);


if( fromFile.equals( toFile ) ) {
if (fromFile.equals(toFile)) {
log("Skipping self-copy of " + fromFile, verbosity); log("Skipping self-copy of " + fromFile, verbosity);
continue; continue;
} }
@@ -516,7 +518,7 @@ public class Copy extends Task {
for (Enumeration filterEnum = filterSets.elements(); for (Enumeration filterEnum = filterSets.elements();
filterEnum.hasMoreElements();) { filterEnum.hasMoreElements();) {
executionFilters executionFilters
.addFilterSet((FilterSet)filterEnum.nextElement());
.addFilterSet((FilterSet) filterEnum.nextElement());
} }
fileUtils.copyFile(fromFile, toFile, executionFilters, fileUtils.copyFile(fromFile, toFile, executionFilters,
filterChains, forceOverwrite, filterChains, forceOverwrite,
@@ -534,7 +536,7 @@ public class Copy extends Task {
Enumeration e = dirCopyMap.elements(); Enumeration e = dirCopyMap.elements();
int count = 0; int count = 0;
while (e.hasMoreElements()) { while (e.hasMoreElements()) {
File d = new File((String)e.nextElement());
File d = new File((String) e.nextElement());
if (!d.exists()) { if (!d.exists()) {
if (!d.mkdirs()) { if (!d.mkdirs()) {
log("Unable to create directory " log("Unable to create directory "
@@ -548,7 +550,7 @@ public class Copy extends Task {
if (count > 0) { if (count > 0) {
log("Copied " + count + log("Copied " + count +
" empty director" + " empty director" +
(count==1?"y":"ies") +
(count == 1 ? "y" : "ies") +
" to " + destDir.getAbsolutePath()); " to " + destDir.getAbsolutePath());
} }
} }


+ 2
- 2
src/main/org/apache/tools/ant/taskdefs/Copydir.java View File

@@ -110,8 +110,8 @@ public class Copydir extends MatchingTask {
} }


if (!srcDir.exists()) { if (!srcDir.exists()) {
throw new BuildException("srcdir "+srcDir.toString()
+" does not exist!", location);
throw new BuildException("srcdir " + srcDir.toString()
+ " does not exist!", location);
} }


if (destDir == null) { if (destDir == null) {


+ 28
- 28
src/main/org/apache/tools/ant/taskdefs/Definer.java View File

@@ -111,22 +111,22 @@ public abstract class Definer extends Task {
} }


public void execute() throws BuildException { public void execute() throws BuildException {
AntClassLoader al=createLoader();
AntClassLoader al = createLoader();


if (file==null && resource==null ) {
if (file == null && resource == null) {


// simple case - one definition // simple case - one definition
if ( name==null || value==null ) {
if (name == null || value == null) {
String msg = "name or classname attributes of " String msg = "name or classname attributes of "
+ getTaskName() + " element " + getTaskName() + " element "
+ "are undefined"; + "are undefined";
throw new BuildException(msg); throw new BuildException(msg);
} }
addDefinition( al, name, value );
addDefinition(al, name, value);


} else { } else {


InputStream is=null;
InputStream is = null;
try { try {
if (name != null || value != null) { if (name != null || value != null) {
String msg = "You must not specify name or value " String msg = "You must not specify name or value "
@@ -141,20 +141,20 @@ public abstract class Definer extends Task {
} }


Properties props=new Properties();
if( file != null ) {
Properties props = new Properties();
if (file != null) {
log("Loading definitions from file " + file, log("Loading definitions from file " + file,
Project.MSG_VERBOSE); Project.MSG_VERBOSE);
is=new FileInputStream( file );
is = new FileInputStream(file);
if (is == null) { if (is == null) {
log("Could not load definitions from file " + file log("Could not load definitions from file " + file
+ ". It doesn\'t exist.", Project.MSG_WARN); + ". It doesn\'t exist.", Project.MSG_WARN);
} }
} }
if( resource!=null ) {
if (resource != null) {
log("Loading definitions from resource " + resource, log("Loading definitions from resource " + resource,
Project.MSG_VERBOSE); Project.MSG_VERBOSE);
is=al.getResourceAsStream( resource );
is = al.getResourceAsStream(resource);
if (is == null) { if (is == null) {
log("Could not load definitions from resource " log("Could not load definitions from resource "
+ resource + ". It could not be found.", + resource + ". It could not be found.",
@@ -162,16 +162,16 @@ public abstract class Definer extends Task {
} }
} }


if( is!=null ) {
props.load( is );
Enumeration keys=props.keys();
while( keys.hasMoreElements() ) {
String n=(String)keys.nextElement();
String v=props.getProperty( n );
addDefinition( al, n, v );
if (is != null) {
props.load(is);
Enumeration keys = props.keys();
while (keys.hasMoreElements()) {
String n = (String) keys.nextElement();
String v = props.getProperty(n);
addDefinition(al, n, v);
} }
} }
} catch( IOException ex ) {
} catch (IOException ex) {
throw new BuildException(ex, location); throw new BuildException(ex, location);
} finally { } finally {
if (is != null) { if (is != null) {
@@ -183,19 +183,19 @@ public abstract class Definer extends Task {
} }
} }
private void addDefinition( ClassLoader al, String name, String value )
private void addDefinition(ClassLoader al, String name, String value)
throws BuildException { throws BuildException {
try { try {
Class c = al.loadClass(value); Class c = al.loadClass(value);
AntClassLoader.initializeClass(c); AntClassLoader.initializeClass(c);
addDefinition(name, c); addDefinition(name, c);
} catch (ClassNotFoundException cnfe) { } catch (ClassNotFoundException cnfe) {
String msg = getTaskName()+" class " + value +
" cannot be found";
String msg = getTaskName() + " class " + value
+ " cannot be found";
throw new BuildException(msg, cnfe, location); throw new BuildException(msg, cnfe, location);
} catch (NoClassDefFoundError ncdfe) { } catch (NoClassDefFoundError ncdfe) {
String msg = getTaskName()+" class " + value +
" cannot be found";
String msg = getTaskName() + " class " + value
+ " cannot be found";
throw new BuildException(msg, ncdfe, location); throw new BuildException(msg, ncdfe, location);
} }
} }
@@ -216,15 +216,15 @@ public abstract class Definer extends Task {
return al; return al;
} }


public void setFile( File file ) {
this.file=file;
public void setFile(File file) {
this.file = file;
} }


public void setResource( String res ) {
this.resource=res;
public void setResource(String res) {
this.resource = res;
} }


public void setName( String name) {
public void setName(String name) {
this.name = name; this.name = name;
} }




+ 1
- 1
src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapter.java View File

@@ -76,7 +76,7 @@ public interface CompilerAdapter {
/** /**
* Sets the compiler attributes, which are stored in the Javac task. * Sets the compiler attributes, which are stored in the Javac task.
*/ */
void setJavac( Javac attributes );
void setJavac(Javac attributes);


/** /**
* Executes the task. * Executes the task.


+ 15
- 15
src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapterFactory.java View File

@@ -92,23 +92,23 @@ public class CompilerAdapterFactory {
* @throws BuildException if the compiler type could not be resolved into * @throws BuildException if the compiler type could not be resolved into
* a compiler adapter. * a compiler adapter.
*/ */
public static CompilerAdapter getCompiler( String compilerType, Task task )
public static CompilerAdapter getCompiler(String compilerType, Task task)
throws BuildException { throws BuildException {
/* If I've done things right, this should be the extent of the /* If I've done things right, this should be the extent of the
* conditional statements required. * conditional statements required.
*/ */
if ( compilerType.equalsIgnoreCase("jikes") ) {
if (compilerType.equalsIgnoreCase("jikes")) {
return new Jikes(); return new Jikes();
} }
if ( compilerType.equalsIgnoreCase("extJavac") ) {
if (compilerType.equalsIgnoreCase("extJavac")) {
return new JavacExternal(); return new JavacExternal();
} }
if ( compilerType.equalsIgnoreCase("classic") ||
if (compilerType.equalsIgnoreCase("classic") ||
compilerType.equalsIgnoreCase("javac1.1") || compilerType.equalsIgnoreCase("javac1.1") ||
compilerType.equalsIgnoreCase("javac1.2")) { compilerType.equalsIgnoreCase("javac1.2")) {
return new Javac12(); return new Javac12();
} }
if ( compilerType.equalsIgnoreCase("modern") ||
if (compilerType.equalsIgnoreCase("modern") ||
compilerType.equalsIgnoreCase("javac1.3") || compilerType.equalsIgnoreCase("javac1.3") ||
compilerType.equalsIgnoreCase("javac1.4")) { compilerType.equalsIgnoreCase("javac1.4")) {
// does the modern compiler exist? // does the modern compiler exist?
@@ -121,21 +121,21 @@ public class CompilerAdapterFactory {
} }
return new Javac13(); return new Javac13();
} }
if ( compilerType.equalsIgnoreCase("jvc") ||
if (compilerType.equalsIgnoreCase("jvc") ||
compilerType.equalsIgnoreCase("microsoft")) { compilerType.equalsIgnoreCase("microsoft")) {
return new Jvc(); return new Jvc();
} }
if ( compilerType.equalsIgnoreCase("kjc") ) {
if (compilerType.equalsIgnoreCase("kjc")) {
return new Kjc(); return new Kjc();
} }
if ( compilerType.equalsIgnoreCase("gcj") ) {
if (compilerType.equalsIgnoreCase("gcj")) {
return new Gcj(); return new Gcj();
} }
if (compilerType.equalsIgnoreCase("sj") || if (compilerType.equalsIgnoreCase("sj") ||
compilerType.equalsIgnoreCase("symantec")) { compilerType.equalsIgnoreCase("symantec")) {
return new Sj(); return new Sj();
} }
return resolveClassName( compilerType );
return resolveClassName(compilerType);
} }


/** /**
@@ -146,18 +146,18 @@ public class CompilerAdapterFactory {
* @throws BuildException This is the fit that is thrown if className * @throws BuildException This is the fit that is thrown if className
* isn't an instance of CompilerAdapter. * isn't an instance of CompilerAdapter.
*/ */
private static CompilerAdapter resolveClassName( String className )
private static CompilerAdapter resolveClassName(String className)
throws BuildException { throws BuildException {
try { try {
Class c = Class.forName( className );
Class c = Class.forName(className);
Object o = c.newInstance(); Object o = c.newInstance();
return (CompilerAdapter) o; return (CompilerAdapter) o;
} catch ( ClassNotFoundException cnfe ) {
throw new BuildException( className + " can\'t be found.", cnfe );
} catch ( ClassCastException cce ) {
} catch (ClassNotFoundException cnfe) {
throw new BuildException(className + " can\'t be found.", cnfe);
} catch (ClassCastException cce) {
throw new BuildException(className + " isn\'t the classname of " throw new BuildException(className + " isn\'t the classname of "
+ "a compiler adapter.", cce); + "a compiler adapter.", cce);
} catch ( Throwable t ) {
} catch (Throwable t) {
// for all other possibilities // for all other possibilities
throw new BuildException(className + " caused an interesting " throw new BuildException(className + " caused an interesting "
+ "exception.", t); + "exception.", t);


+ 5
- 5
src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java View File

@@ -113,7 +113,7 @@ public abstract class DefaultCompilerAdapter implements CompilerAdapter {


private FileUtils fileUtils = FileUtils.newFileUtils(); private FileUtils fileUtils = FileUtils.newFileUtils();


public void setJavac( Javac attributes ) {
public void setJavac(Javac attributes) {
this.attributes = attributes; this.attributes = attributes;
src = attributes.getSrcdir(); src = attributes.getSrcdir();
destDir = attributes.getDestdir(); destDir = attributes.getDestdir();
@@ -159,11 +159,11 @@ public abstract class DefaultCompilerAdapter implements CompilerAdapter {
// order determined by the value of build.classpath // order determined by the value of build.classpath


if (compileClasspath == null) { if (compileClasspath == null) {
if ( includeAntRuntime ) {
if (includeAntRuntime) {
classpath.addExisting(Path.systemClasspath); classpath.addExisting(Path.systemClasspath);
} }
} else { } else {
if ( includeAntRuntime ) {
if (includeAntRuntime) {
classpath.addExisting(compileClasspath classpath.addExisting(compileClasspath
.concatSystemClasspath("last")); .concatSystemClasspath("last"));
} else { } else {
@@ -381,7 +381,7 @@ public abstract class DefaultCompilerAdapter implements CompilerAdapter {


niceSourceList.append(lSep); niceSourceList.append(lSep);


for (int i=0; i < compileList.length; i++) {
for (int i = 0; i < compileList.length; i++) {
String arg = compileList[i].getAbsolutePath(); String arg = compileList[i].getAbsolutePath();
cmd.createArgument().setValue(arg); cmd.createArgument().setValue(arg);
niceSourceList.append(" " + arg + lSep); niceSourceList.append(" " + arg + lSep);
@@ -418,7 +418,7 @@ public abstract class DefaultCompilerAdapter implements CompilerAdapter {
out.println(args[i]); out.println(args[i]);
} }
out.flush(); out.flush();
commandArray = new String[firstFileName+1];
commandArray = new String[firstFileName + 1];
System.arraycopy(args, 0, commandArray, 0, firstFileName); System.arraycopy(args, 0, commandArray, 0, firstFileName);
commandArray[firstFileName] = "@" + tmpFile; commandArray[firstFileName] = "@" + tmpFile;
} catch (IOException e) { } catch (IOException e) {


+ 2
- 2
src/main/org/apache/tools/ant/taskdefs/compilers/Gcj.java View File

@@ -98,7 +98,7 @@ public class Gcj extends DefaultCompilerAdapter {
// so we'll emulate it for compatibility and convenience. // so we'll emulate it for compatibility and convenience.
classpath.addExtdirs(extdirs); classpath.addExtdirs(extdirs);


if ( (bootclasspath == null) || (bootclasspath.size() == 0) ) {
if (bootclasspath == null || bootclasspath.size() == 0) {
// no bootclasspath, therefore, get one from the java runtime // no bootclasspath, therefore, get one from the java runtime
includeJavaRuntime = true; includeJavaRuntime = true;
} }
@@ -114,7 +114,7 @@ public class Gcj extends DefaultCompilerAdapter {
cmd.createArgument().setValue("-d"); cmd.createArgument().setValue("-d");
cmd.createArgument().setFile(destDir); cmd.createArgument().setFile(destDir);
if(destDir.mkdirs()){
if (destDir.mkdirs()) {
throw new BuildException("Can't make output directories. " throw new BuildException("Can't make output directories. "
+ "Maybe permission is wrong. "); + "Maybe permission is wrong. ");
}; };


+ 1
- 1
src/main/org/apache/tools/ant/taskdefs/compilers/Javac12.java View File

@@ -97,7 +97,7 @@ public class Javac12 extends DefaultCompilerAdapter {
Method compile = c.getMethod("compile", Method compile = c.getMethod("compile",
new Class [] { String[].class }); new Class [] { String[].class });
Boolean ok = Boolean ok =
(Boolean)compile.invoke(compiler,
(Boolean) compile.invoke(compiler,
new Object[] {cmd.getArguments()}); new Object[] {cmd.getArguments()});
return ok.booleanValue(); return ok.booleanValue();
} }


+ 1
- 1
src/main/org/apache/tools/ant/taskdefs/compilers/Jikes.java View File

@@ -97,7 +97,7 @@ public class Jikes extends DefaultCompilerAdapter {
// so we'll emulate it for compatibility and convenience. // so we'll emulate it for compatibility and convenience.
classpath.addExtdirs(extdirs); classpath.addExtdirs(extdirs);


if ( (bootclasspath == null) || (bootclasspath.size() == 0) ) {
if (bootclasspath == null || bootclasspath.size() == 0) {
// no bootclasspath, therefore, get one from the java runtime // no bootclasspath, therefore, get one from the java runtime
includeJavaRuntime = true; includeJavaRuntime = true;
} else { } else {


+ 1
- 1
src/main/org/apache/tools/ant/taskdefs/compilers/Jvc.java View File

@@ -87,7 +87,7 @@ public class Jvc extends DefaultCompilerAdapter {
// so we'll emulate it for compatibility and convenience. // so we'll emulate it for compatibility and convenience.
classpath.addExtdirs(extdirs); classpath.addExtdirs(extdirs);


if ( (bootclasspath == null) || (bootclasspath.size() == 0) ) {
if (bootclasspath == null || bootclasspath.size() == 0) {
// no bootclasspath, therefore, get one from the java runtime // no bootclasspath, therefore, get one from the java runtime
includeJavaRuntime = true; includeJavaRuntime = true;
} else { } else {


+ 1
- 1
src/main/org/apache/tools/ant/taskdefs/compilers/Kjc.java View File

@@ -85,7 +85,7 @@ public class Kjc extends DefaultCompilerAdapter {
Method compile = c.getMethod("compile", Method compile = c.getMethod("compile",
new Class [] { String [].class }); new Class [] { String [].class });
Boolean ok = Boolean ok =
(Boolean)compile.invoke(null,
(Boolean) compile.invoke(null,
new Object[] {cmd.getArguments()}); new Object[] {cmd.getArguments()});
return ok.booleanValue(); return ok.booleanValue();
} }


Loading…
Cancel
Save