bodewig 2003/04/29 06:27:38
Modified: src/main/org/apache/tools/ant/taskdefs/optional/sitraka CovBase.java CovMerge.java Log: A more defensive approach to PR: 14849, keep things as they've been unless we are using JProbe 4+. Revision Changes Path 1.3 +7 -0 ant/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/CovBase.java Index: CovBase.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/CovBase.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- CovBase.java 3 Apr 2003 08:48:50 -0000 1.2 +++ CovBase.java 29 Apr 2003 13:27:38 -0000 1.3 @@ -129,4 +129,11 @@ protected String getParamFileArgument() { return (!isJProbe4 ? "-jp_" : "") + "paramfile="; } + + /** + * Are we running on a version of JProbe 4.x or higher? + */ + protected boolean isJProbe4Plus() { + return isJProbe4; + } } 1.19 +10 -2 ant/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/CovMerge.java Index: CovMerge.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/CovMerge.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- CovMerge.java 28 Apr 2003 10:07:11 -0000 1.18 +++ CovMerge.java 29 Apr 2003 13:27:38 -0000 1.19 @@ -124,8 +124,11 @@ cmdl.createArgument().setValue(getParamFileArgument() + paramfile.getAbsolutePath()); - // last argument is the output snapshot - cmdl.createArgument().setValue(tofile.getPath()); + if (isJProbe4Plus()) { + // last argument is the output snapshot - JProbe 4.x + // doesn't like it in the parameter file. + cmdl.createArgument().setValue(tofile.getPath()); + } LogStreamHandler handler = new LogStreamHandler(this, Project.MSG_INFO, Project.MSG_WARN); Execute exec = new Execute(handler); @@ -198,6 +201,11 @@ PrintWriter pw = new PrintWriter(fw); for (int i = 0; i < snapshots.length; i++) { pw.println(snapshots[i].getAbsolutePath()); + } + if (!isJProbe4Plus()) { + // last file is the output snapshot - JProbe 4.x doesn't + // like it in the parameter file. + pw.println(getProject().resolveFile(tofile.getPath())); } pw.flush(); } catch (IOException e) {