Browse Source

whitespace

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@805355 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 16 years ago
parent
commit
e5a9933414
1 changed files with 51 additions and 51 deletions
  1. +51
    -51
      src/main/org/apache/tools/ant/taskdefs/Rmic.java

+ 51
- 51
src/main/org/apache/tools/ant/taskdefs/Rmic.java View File

@@ -82,7 +82,7 @@ public class Rmic extends MatchingTask {


/** rmic failed message */ /** rmic failed message */
public static final String ERROR_RMIC_FAILED public static final String ERROR_RMIC_FAILED
= "Rmic failed; see the compiler error output for details.";
= "Rmic failed; see the compiler error output for details.";


private File baseDir; private File baseDir;
private File destDir; private File destDir;
@@ -591,58 +591,58 @@ public class Rmic extends MatchingTask {
Path classpath = adapter.getClasspath(); Path classpath = adapter.getClasspath();
loader = getProject().createClassLoader(classpath); loader = getProject().createClassLoader(classpath);


// scan base dirs to build up compile lists only if a
// specific classname is not given
if (classname == null) {
DirectoryScanner ds = this.getDirectoryScanner(baseDir);
String[] files = ds.getIncludedFiles();
scanDir(baseDir, files, adapter.getMapper());
// scan base dirs to build up compile lists only if a
// specific classname is not given
if (classname == null) {
DirectoryScanner ds = this.getDirectoryScanner(baseDir);
String[] files = ds.getIncludedFiles();
scanDir(baseDir, files, adapter.getMapper());
} else {
// otherwise perform a timestamp comparison - at least
String path = classname.replace('.', File.separatorChar) + ".class";
File f = new File(baseDir, path);
if (f.isFile()) {
scanDir(baseDir, new String[] {path}, adapter.getMapper());
} else { } else {
// otherwise perform a timestamp comparison - at least
String path = classname.replace('.', File.separatorChar) + ".class";
File f = new File(baseDir, path);
if (f.isFile()) {
scanDir(baseDir, new String[] {path}, adapter.getMapper());
} else {
// Does not exist, so checking whether it is up to date makes no sense.
// Compilation will fail later anyway, but tests expect a certain output.
compileList.add(classname);
}
// Does not exist, so checking whether it is up to date makes no sense.
// Compilation will fail later anyway, but tests expect a certain output.
compileList.add(classname);
} }
int fileCount = compileList.size();
if (fileCount > 0) {
log("RMI Compiling " + fileCount + " class"
+ (fileCount > 1 ? "es" : "") + " to "
+ outputDir, Project.MSG_INFO);
if (listFiles) {
for (int i = 0; i < fileCount; i++) {
log(compileList.get(i).toString());
}
}
int fileCount = compileList.size();
if (fileCount > 0) {
log("RMI Compiling " + fileCount + " class"
+ (fileCount > 1 ? "es" : "") + " to "
+ outputDir, Project.MSG_INFO);
if (listFiles) {
for (int i = 0; i < fileCount; i++) {
log(compileList.get(i).toString());
} }
}


// finally, lets execute the compiler!!
if (!adapter.execute()) {
throw new BuildException(ERROR_RMIC_FAILED, getLocation());
}
// finally, lets execute the compiler!!
if (!adapter.execute()) {
throw new BuildException(ERROR_RMIC_FAILED, getLocation());
} }
/*
* Move the generated source file to the base directory. If
* base directory and sourcebase are the same, the generated
* sources are already in place.
*/
if (null != sourceBase && !outputDir.equals(sourceBase)
&& fileCount > 0) {
if (idl) {
log("Cannot determine sourcefiles in idl mode, ", Project.MSG_WARN);
log("sourcebase attribute will be ignored.", Project.MSG_WARN);
} else {
for (int j = 0; j < fileCount; j++) {
moveGeneratedFile(outputDir, sourceBase, (String) compileList.elementAt(j),
adapter);
}
}
/*
* Move the generated source file to the base directory. If
* base directory and sourcebase are the same, the generated
* sources are already in place.
*/
if (null != sourceBase && !outputDir.equals(sourceBase)
&& fileCount > 0) {
if (idl) {
log("Cannot determine sourcefiles in idl mode, ", Project.MSG_WARN);
log("sourcebase attribute will be ignored.", Project.MSG_WARN);
} else {
for (int j = 0; j < fileCount; j++) {
moveGeneratedFile(outputDir, sourceBase, (String) compileList.elementAt(j),
adapter);
} }
} }
}
} }


/** /**
@@ -652,7 +652,7 @@ public class Rmic extends MatchingTask {
* copying/removing files. * copying/removing files.
*/ */
private void moveGeneratedFile(File baseDir, File sourceBaseFile, String classname, private void moveGeneratedFile(File baseDir, File sourceBaseFile, String classname,
RmicAdapter adapter) throws BuildException {
RmicAdapter adapter) throws BuildException {
String classFileName = classname.replace('.', File.separatorChar) + ".class"; String classFileName = classname.replace('.', File.separatorChar) + ".class";
String[] generatedFiles = adapter.getMapper().mapFileName(classFileName); String[] generatedFiles = adapter.getMapper().mapFileName(classFileName);


@@ -675,14 +675,14 @@ public class Rmic extends MatchingTask {
try { try {
if (filtering) { if (filtering) {
FILE_UTILS.copyFile(oldFile, newFile, new FilterSetCollection(getProject() FILE_UTILS.copyFile(oldFile, newFile, new FilterSetCollection(getProject()
.getGlobalFilterSet()));
.getGlobalFilterSet()));
} else { } else {
FILE_UTILS.copyFile(oldFile, newFile); FILE_UTILS.copyFile(oldFile, newFile);
} }
oldFile.delete(); oldFile.delete();
} catch (IOException ioe) { } catch (IOException ioe) {
String msg = "Failed to copy " + oldFile + " to " + newFile + " due to " String msg = "Failed to copy " + oldFile + " to " + newFile + " due to "
+ ioe.getMessage();
+ ioe.getMessage();
throw new BuildException(msg, ioe, getLocation()); throw new BuildException(msg, ioe, getLocation());
} }
} }
@@ -732,7 +732,7 @@ public class Rmic extends MatchingTask {
log(ERROR_UNABLE_TO_VERIFY_CLASS + classname + ERROR_NOT_DEFINED, Project.MSG_WARN); log(ERROR_UNABLE_TO_VERIFY_CLASS + classname + ERROR_NOT_DEFINED, Project.MSG_WARN);
} catch (Throwable t) { } catch (Throwable t) {
log(ERROR_UNABLE_TO_VERIFY_CLASS + classname + ERROR_LOADING_CAUSED_EXCEPTION log(ERROR_UNABLE_TO_VERIFY_CLASS + classname + ERROR_LOADING_CAUSED_EXCEPTION
+ t.getMessage(), Project.MSG_WARN);
+ t.getMessage(), Project.MSG_WARN);
} }
// we only get here if an exception has been thrown // we only get here if an exception has been thrown
return false; return false;
@@ -781,7 +781,7 @@ public class Rmic extends MatchingTask {
* implementation. * implementation.
*/ */
public class ImplementationSpecificArgument extends public class ImplementationSpecificArgument extends
org.apache.tools.ant.util.facade.ImplementationSpecificArgument {
org.apache.tools.ant.util.facade.ImplementationSpecificArgument {
/** /**
* Only pass the specified argument if the * Only pass the specified argument if the
* chosen compiler implementation matches the * chosen compiler implementation matches the


Loading…
Cancel
Save