changeset 39:c92eeb0e0400

Merge
author shurailine
date Wed, 16 May 2018 11:43:34 -0700
parents 2e8d8c4675db 0b9e41807b07
children 0ad271c037d5
files
diffstat 3 files changed, 14 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/src/classes/com/sun/tdk/jcov/RepGen.java	Wed May 16 11:41:39 2018 -0700
+++ b/src/classes/com/sun/tdk/jcov/RepGen.java	Wed May 16 11:43:34 2018 -0700
@@ -517,6 +517,10 @@
         return srcRootPath;
     }
 
+    public void setDataProcessorsSPIs(DataProcessorSPI[] dataProcessorSPIs){
+        this.dataProcessorSPIs = dataProcessorSPIs;
+    }
+
     /**
      * Reset all properties to defaults. reportGeneratorSPI = null; include =
      * new String[] {".*"}; exclude = new String[] {""}; fms = null; filter =
@@ -664,7 +668,8 @@
         if (classesPath != null) {
             try {
                 logger.log(Level.INFO, "-- Creating javap report");
-                new JavapRepGen(include, exclude).run(filenames[0], classesPath, outputDir);
+                setDataProcessorsSPIs(null);
+                new JavapRepGen(this).run(filenames[0], classesPath, outputDir);
                 return 0;
             } catch (Exception ex) {
                 logger.log(Level.SEVERE, "Error while creating javap report", ex);
--- a/src/classes/com/sun/tdk/jcov/ant/Report.java	Wed May 16 11:41:39 2018 -0700
+++ b/src/classes/com/sun/tdk/jcov/ant/Report.java	Wed May 16 11:43:34 2018 -0700
@@ -172,7 +172,8 @@
             if (filename != null) {
 
                 if (javap != null) {
-                    new JavapRepGen(repGen.getInclude(), repGen.getExclude()).run(filename.getPath(), javap, destdir.getPath());
+                    repGen.setDataProcessorsSPIs(null);
+                    new JavapRepGen(repGen).run(filename.getPath(), javap, destdir.getPath());
                     if (propfile != null) {
                         PropertyFinder.cleanProperties();
                     }
--- a/src/classes/com/sun/tdk/jcov/report/javap/JavapRepGen.java	Wed May 16 11:41:39 2018 -0700
+++ b/src/classes/com/sun/tdk/jcov/report/javap/JavapRepGen.java	Wed May 16 11:43:34 2018 -0700
@@ -51,12 +51,10 @@
  */
 public class JavapRepGen {
 
-    private String[] include;
-    private String[] exclude;
+    private RepGen repGen;
 
-    public JavapRepGen(String[] include, String[] exclude) {
-        this.include = include == null ? new String[]{".*"} : include;
-        this.exclude = exclude == null ? new String[]{""} : exclude;
+    public JavapRepGen(RepGen repGen){
+        this.repGen = repGen;
     }
 
     /**
@@ -198,12 +196,9 @@
             }
         }
 
-        RepGen rg = new RepGen();
-        rg.configure(include, exclude, null, null, false, false, false, false, false, false, false, false);
-
         try {
             Result res = new Result(templatePath);
-            rg.generateReport(rg.getDefaultReportGenerator(), outPath, res, null, new ArrayList(classes.values()));
+            repGen.generateReport(repGen.getDefaultReportGenerator(), outPath, res, null, new ArrayList(classes.values()));
         } catch (Exception e) {
             System.err.println("error in report generation: " + e);
         }
@@ -226,7 +221,7 @@
                 if (className.endsWith(".class")) {
                     className = className.substring(0, className.lastIndexOf(".class"));
                 }
-                if (Utils.accept(Utils.concatFilters(include, exclude), null, "/" + className, null)) {
+                if (Utils.accept(Utils.concatFilters(repGen.getInclude(), repGen.getExclude()), null, "/" + className, null)) {
                     newFiles.add(classFile);
                 }
 
@@ -244,7 +239,7 @@
 
         for (String classFile : filesInJar) {
 
-            if (Utils.accept(Utils.concatFilters(include, exclude), null, "/" + classFile.replaceAll("\\.", "/"), null)) {
+            if (Utils.accept(Utils.concatFilters(repGen.getInclude(), repGen.getExclude()), null, "/" + classFile.replaceAll("\\.", "/"), null)) {
                 newFilesInJar.add(classFile);
             }