Browse Source

[192-webreport] Using getExcludedFiles

Evgeni 4 years ago
parent
commit
7154433b39

+ 3 - 3
jplag/src/main/java/de/jplag/reportingV2/reportobject/ReportObjectFactory.java

@@ -46,7 +46,7 @@ public class ReportObjectFactory {
         overviewReport.setFile_extensions(List.of(result.getOptions().getFileSuffixes()));
         overviewReport.setSubmission_ids(extractSubmissionNames(comparisons));
         overviewReport.setFailed_submission_names(List.of());  // No number of failed submissions
-        overviewReport.setExcluded_files(getExcludedFilesNames(result.getOptions())); // Read exclusion file
+        overviewReport.setExcluded_files(result.getOptions().getExcludedFiles());
         overviewReport.setMatch_sensitivity(result.getOptions().getMinimumTokenMatch());
         overviewReport.setDate_of_execution(getDate());
         overviewReport.setExecution_time(result.getDuration());
@@ -186,7 +186,7 @@ public class ReportObjectFactory {
         return new Match(startTokenFirst.file, startTokenSecond.file, startFirst, endFirst, startSecond, endSecond, tokens);
     }
 
-    // TODO implement after PR Readd clustering #281
+    // TODO implement after PR Read clustering #281
     private static List<Cluster> getClusters(JPlagResult result) {
         // List<ClusteringResult<Submission>> clusters = result.getClusteringResult();
         // return clusters.map( c -> new Cluster(getAvgSimilarity, getStrength, c.getMembers().map(Submission::getName)))
@@ -194,7 +194,7 @@ public class ReportObjectFactory {
     }
 
     private static List<String> readFileLines(File file) {
-        ArrayList<String> lines = new ArrayList<>();
+        List<String> lines = new ArrayList<>();
         try {
             BufferedReader bufferedReader = new BufferedReader(new FileReader(file));
             String line;

+ 6 - 5
jplag/src/main/java/de/jplag/reportingV2/reportobject/model/OverviewReport.java

@@ -1,6 +1,7 @@
 package de.jplag.reportingV2.reportobject.model;
 
 import java.util.List;
+import java.util.Set;
 
 public class OverviewReport {
 
@@ -10,7 +11,7 @@ public class OverviewReport {
     private List<String> file_extensions;
     private List<String> submission_ids;
     private List<String> failed_submission_names;
-    private List<String> excluded_files;
+    private Set<String> excluded_files;
     private int match_sensitivity;
     private String date_of_execution;
     private long execution_time;
@@ -25,7 +26,7 @@ public class OverviewReport {
         file_extensions = List.of();
         submission_ids = List.of();
         failed_submission_names = List.of();
-        excluded_files = List.of();
+        excluded_files = Set.of();
         match_sensitivity = 0;
         date_of_execution = "";
         execution_time = 0;
@@ -60,7 +61,7 @@ public class OverviewReport {
         return failed_submission_names;
     }
 
-    public List<String> getExcluded_files() {
+    public Set<String> getExcluded_files() {
         return excluded_files;
     }
 
@@ -116,8 +117,8 @@ public class OverviewReport {
         this.failed_submission_names = List.copyOf(failed_submission_names);
     }
 
-    public void setExcluded_files(List<String> excluded_files) {
-        this.excluded_files = List.copyOf(excluded_files);
+    public void setExcluded_files(Set<String> excluded_files) {
+        this.excluded_files = Set.copyOf(excluded_files);
     }
 
     public void setMatch_sensitivity(int match_sensitivity) {