ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sbaill...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/sitraka Coverage.java CovMerge.java CovReport.java XMLReport.java
Date Sat, 01 Dec 2001 00:00:46 GMT
sbailliez    01/11/30 16:00:46

  Modified:    src/main/org/apache/tools/ant/taskdefs/optional/sitraka
                        Coverage.java CovMerge.java CovReport.java
                        XMLReport.java
  Log:
  - Fixed some case issues related to JProbe directories under Solaris.
  - SourceFile attribute does not always exists in the bytecode, so take care of it.
  
  PR: 5217
  Submitted by: garrick.olson@aceva.com (Garrick Olson)
  
  Revision  Changes    Path
  1.5       +1 -1      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/Coverage.java
  
  Index: Coverage.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/Coverage.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Coverage.java	2001/11/28 01:15:29	1.4
  +++ Coverage.java	2001/12/01 00:00:46	1.5
  @@ -297,7 +297,7 @@
           if (home == null || !home.isDirectory()) {
               throw new BuildException("Invalid home directory. Must point to JProbe home
directory");
           }
  -        home = new File(home, "Coverage");
  +        home = new File(home, "coverage");
           File jar = new File(home, "coverage.jar");
           if (!jar.exists()) {
               throw new BuildException("Cannot find Coverage directory: " + home);
  
  
  
  1.5       +4 -3      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/CovMerge.java
  
  Index: CovMerge.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/CovMerge.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- CovMerge.java	2001/11/18 11:41:06	1.4
  +++ CovMerge.java	2001/12/01 00:00:46	1.5
  @@ -160,7 +160,7 @@
           if (home == null || !home.isDirectory()) {
               throw new BuildException("Invalid home directory. Must point to JProbe home
directory");
           }
  -        home = new File(home, "Coverage");
  +        home = new File(home, "coverage");
           File jar = new File(home, "coverage.jar");
           if (!jar.exists()) {
               throw new BuildException("Cannot find Coverage directory: " + home);
  @@ -207,16 +207,17 @@
               // last file is the output snapshot
               pw.println(project.resolveFile(tofile.getPath()));
               pw.flush();
  -            return file;
           } catch (IOException e) {
  +            throw new BuildException("I/O error while writing to " + file, e);
  +        } finally {
               if (fw != null) {
                   try {
                       fw.close();
                   } catch (IOException ignored) {
                   }
               }
  -            throw new BuildException("I/O error while writing to " + file, e);
           }
  +        return file;
       }
   
       /** create a temporary file in the current dir (For JDK1.1 support) */
  
  
  
  1.5       +1 -1      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/CovReport.java
  
  Index: CovReport.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/CovReport.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- CovReport.java	2001/11/18 11:41:06	1.4
  +++ CovReport.java	2001/12/01 00:00:46	1.5
  @@ -256,7 +256,7 @@
           if (home == null) {
               throw new BuildException("'home' attribute must be set to JProbe home directory");
           }
  -        home = new File(home, "Coverage");
  +        home = new File(home, "coverage");
           File jar = new File(home, "coverage.jar");
           if (!jar.exists()) {
               throw new BuildException("Cannot find Coverage directory: " + home);
  
  
  
  1.8       +5 -2      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/XMLReport.java
  
  Index: XMLReport.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/XMLReport.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- XMLReport.java	2001/11/27 18:04:53	1.7
  +++ XMLReport.java	2001/12/01 00:00:46	1.8
  @@ -210,7 +210,7 @@
           DocumentBuilder dbuilder = newBuilder();
           InputSource is = new InputSource(new FileInputStream(file));
           if (jprobeHome != null) {
  -            File dtdDir = new File(jprobeHome, "Dtd");
  +            File dtdDir = new File(jprobeHome, "dtd");
               is.setSystemId("file:///" + dtdDir.getAbsolutePath() + "/");
           }
           report = dbuilder.parse(is);
  @@ -324,7 +324,10 @@
           // create the class element
           Element classElem = report.createElement("class");
           classElem.setAttribute("name", classFile.getName());
  -        classElem.setAttribute("source", classFile.getSourceFile());
  +        // source file possibly does not exist in the bytecode
  +        if ( null != classFile.getSourceFile() ){
  +            classElem.setAttribute("source", classFile.getSourceFile());
  +        }
           // create the cov.data elem
           Element classData = report.createElement("cov.data");
           classElem.appendChild(classData);
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message