Fixed wrong matching: Added testName to reopen search for open report jdev_excrep-stable
authorJakub Lehotsky <jlehotsky@netbeans.org>
Tue, 06 Sep 2016 15:38:54 +0200
branchjdev_excrep-stable
changeset 6350961569ddff49
parent 6348 397bac64560c
child 6351 e2abaa64000f
child 6352 671f483cc8a6
Fixed wrong matching: Added testName to reopen search for open report
logger/uihandler.api/src/org/netbeans/server/uihandler/api/bugs/BugTrackerCategorizer.java
logger/uihandlerserver/src/java/org/netbeans/server/uihandler/DbInsertion.java
logger/uihandlerserver/src/java/org/netbeans/server/uihandler/ReopenHandler.java
     1.1 --- a/logger/uihandler.api/src/org/netbeans/server/uihandler/api/bugs/BugTrackerCategorizer.java	Mon Aug 22 16:21:11 2016 +0200
     1.2 +++ b/logger/uihandler.api/src/org/netbeans/server/uihandler/api/bugs/BugTrackerCategorizer.java	Tue Sep 06 15:38:54 2016 +0200
     1.3 @@ -35,7 +35,7 @@
     1.4       * 
     1.5       * This ones checks the open issue for the purpose of reopen
     1.6       */
     1.7 -    Report matchOpenToReport(EntityManager em, Throwable mockThrowable);
     1.8 +    Report matchOpenToReport(EntityManager em, Throwable mockThrowable, String testName);
     1.9      
    1.10      /**
    1.11       * Indicates check for a package name if it is excluded from matching algorithm.
     2.1 --- a/logger/uihandlerserver/src/java/org/netbeans/server/uihandler/DbInsertion.java	Mon Aug 22 16:21:11 2016 +0200
     2.2 +++ b/logger/uihandlerserver/src/java/org/netbeans/server/uihandler/DbInsertion.java	Tue Sep 06 15:38:54 2016 +0200
     2.3 @@ -527,7 +527,7 @@
     2.4          LOG.log(Level.INFO, "Trying to reopen issue exc id: {0}", submit.getId()); // NOI18N
     2.5          Integer issuezillaId = submit.getReportId().getIssueId();
     2.6          EntityManager em = thisTask.getTaskEntityManager();
     2.7 -        Submit afterSplit = ReopenHandler.createHandler(submit).process(em, categorizer);
     2.8 +        Submit afterSplit = ReopenHandler.createHandler(submit).process(em, categorizer, submit.getTestName());
     2.9          em.getTransaction().commit(); // commit reopen handler changes for IZ Insertion
    2.10          em.getTransaction().begin();
    2.11          duplicatesReport = afterSplit.getReportId();
     3.1 --- a/logger/uihandlerserver/src/java/org/netbeans/server/uihandler/ReopenHandler.java	Mon Aug 22 16:21:11 2016 +0200
     3.2 +++ b/logger/uihandlerserver/src/java/org/netbeans/server/uihandler/ReopenHandler.java	Tue Sep 06 15:38:54 2016 +0200
     3.3 @@ -74,7 +74,7 @@
     3.4          }
     3.5      }
     3.6  
     3.7 -    public abstract Submit process(EntityManager em, BugTrackerCategorizer categorizerProvider);
     3.8 +    public abstract Submit process(EntityManager em, BugTrackerCategorizer categorizerProvider, String testName);
     3.9  
    3.10      private static class ExceptionReopenHandler extends ReopenHandler {
    3.11  
    3.12 @@ -85,16 +85,17 @@
    3.13              this.excParam = excParam;
    3.14          }
    3.15  
    3.16 -        public Submit process(EntityManager em, BugTrackerCategorizer categorizer) {
    3.17 +        public Submit process(EntityManager em, BugTrackerCategorizer categorizer, String testName) {
    3.18              actual = em.merge(excParam);
    3.19              BugReporter.LOG.log(Level.INFO, "reopening issue based on exception {0} from {1}",
    3.20                      new Object[]{actual.getId().toString(), actual.getReportId().getId().toString()});
    3.21 -            Report openDuplicateCandidate = categorizer.matchOpenToReport(em, actual.getMockThrowable());
    3.22 +            
    3.23 +            Report openDuplicateCandidate = categorizer.matchOpenToReport(em, actual.getMockThrowable(), testName);
    3.24              if (openDuplicateCandidate != null) {
    3.25                  actual.setReportId(openDuplicateCandidate);
    3.26                  return em.merge(actual);
    3.27 -                
    3.28              }
    3.29 +            
    3.30              Report newReport = new Report();
    3.31              newReport.setId(PersistenceUtils.getNextId(Report.class));
    3.32              // issue 210769
    3.33 @@ -170,7 +171,7 @@
    3.34              this.slownParam = slown;
    3.35          }
    3.36  
    3.37 -        public Submit process(EntityManager em, BugTrackerCategorizer categorizer) {
    3.38 +        public Submit process(EntityManager em, BugTrackerCategorizer categorizer, String testName) {
    3.39              actual = em.merge(slownParam);
    3.40              BugReporter.LOG.log(Level.INFO, "reopening issue based on slowness{0} from {1}",
    3.41                      new Object[]{actual.getId().toString(), actual.getReportId().getId().toString()});