Package org.netbeans.modules.exceptions.entity

Examples of org.netbeans.modules.exceptions.entity.Exceptions


        private void moveSimilarExceptions(EntityManager em, Report candidatesReport, Exceptions master, Report newReport) {
            // protect the first exception report
            candidatesReport.preloadSubmitCollection(em);
            List<Exceptions> candidates = new ArrayList(candidatesReport.getSubmitCollection());
            assert(!candidates.isEmpty());
            Exceptions minimal = candidates.iterator().next();
            for (Exceptions exceptions : candidates) {
                if (exceptions.getId() < minimal.getId()){
                    minimal = exceptions;
                }
            }
            candidates.remove(master);
            candidates.remove(minimal);

            //move exactly the same stacktraces
            Integer mashterHash = master.getHashcodes().getCode();
            Iterator<Exceptions> it = candidates.iterator();
            while (it.hasNext()) {
                Exceptions next = it.next();
                if (next.getHashcodes().getCode().equals(mashterHash)) {
                    it.remove();

                    next.setReportId(newReport);
                    em.merge(next);
                }
            }

            //move other very similar stacktraces
View Full Code Here


        }
        return true;
    }

    private static String getMessageOfTheOriginalExceptionStacktrace(Stacktrace stacktrace){
        Exceptions exc = stacktrace.getExceptions();
        if ((exc == null) || (stacktrace.getAnnotation() != null)){// has inner exception
            return stacktrace.getMessage();
        }
        return exc.getStacktrace().getMessage();
    }
View Full Code Here

        Calendar cal = Calendar.getInstance();
        addExc(cal.getTime());
        cal.roll(Calendar.DAY_OF_YEAR, false);
        addExc(cal.getTime());
        cal.roll(Calendar.DAY_OF_YEAR, false);
        Exceptions last = addExc(cal.getTime());
        addExc(cal.getTime(), last);
        addExc(cal.getTime(), last);
        addExc(cal.getTime(), last);

        ArrayList<TableCell> cellData = new StatisticsAction().recountData(true);
View Full Code Here

    }

    private Exceptions addExc(Date date, Exceptions duplicateOf, Integer issuezillaId){
        EntityManager em = perUtils.createEntityManager();
        em.getTransaction().begin();
        Exceptions exc = new Exceptions(++id);

        exc.setReportdate(date);
        Report report = null;
        if (duplicateOf != null) {
            report = duplicateOf.getReportId();
        } else {
            report = new Report(id);
            em.persist(report);
        }
        exc.setReportId(report);
        if (issuezillaId != null) {
            report.setIssueId(issuezillaId);
            em.merge(report);
        }
        em.persist(exc);
View Full Code Here

            }
            TreeMap<String, Object> params = new TreeMap<String, Object>();
            params.put("code", code);
            List<Hashcodes> resultHashCodes = PersistenceUtils.executeNamedQuery(em, "Hashcodes.findByCode", params, Hashcodes.class);
            for (Hashcodes hashcode : resultHashCodes) {
                Exceptions exc = hashcode.getExceptions();
                if (searchOnlyOpens && !PersistenceUtils.exceptionIsOpen(exc)){
                    continue;
                }
                if (verify(em, thrown, exc) && FilteringUtils.sameMessages(thrown, exc.getStacktrace())){
                    return exc;
                }
            }
            return null;
        }
View Full Code Here

        private void removeClosed(Set<Stacktrace> stackTraceIds) {
            Iterator<Stacktrace> it = stackTraceIds.iterator();
            while (it.hasNext()){
                Stacktrace next = it.next();
                Exceptions exc = FilteringUtils.getRootExceptions(next);
                if (exc == null){
                    Logger.getLogger(CheckingFilter.class.getName()).log(Level.SEVERE, "stacktrace {0} has null exception", next.getId());
                }
                if (!PersistenceUtils.exceptionIsOpen(exc)){
                    it.remove();
View Full Code Here

                stacktracesResult = PersistenceUtils.executeQuery(em, SELECT_STACKTRACE_BY_NAME_FROM_LINE, params);
                for (Stacktrace stacktrace : stacktracesResult) {
                    if (!stacktrace.getClass1().contains(STACK_OVERFLOW_MESSAGE)){
                        continue;
                    }
                    Exceptions exc = FilteringUtils.getRootExceptions(stacktrace);
                    if (searchOnlyOpens && !PersistenceUtils.exceptionIsOpen(exc)){
                        continue;
                    }
                    List<Line> lines = new ArrayList<Line>(stacktrace.getLineCollection());
                    Collections.sort(lines, new LineComparator());
View Full Code Here

        em.persist(lf);

        Report report = new Report(0);
        em.persist(report);

        Exceptions exc = new Exceptions(1);
        exc.setBuild(70927l);
        exc.setReportId(report);
        exc.setLogfileId(lf);
        em.persist(exc);

        exc = new Exceptions(2);
        exc.setBuild(70910l);
        exc.setReportId(report);
        exc.setLogfileId(lf);
        em.persist(exc);

        exc = new Exceptions(3);
        exc.setBuild(70928l);
        exc.setReportId(report);
        exc.setLogfileId(lf);
        em.persist(exc);

        em.getTransaction().commit();
        em.close();
        List<BugReportCounts.Data> result = BugReportCounts.getStats();
View Full Code Here

        buildInfo.setParameters(params);

        Logfile log = new Logfile("dafadf", 1);
        DbInsertion insertion = new DbInsertion(config, new NullPointerException("null11"), buildInfo, new TestLogFileTask(em, log));
        ExceptionsData insertionResult = getInsertionData(insertion);
        Exceptions exc = em.find(Exceptions.class, insertionResult.getSubmitId());
        assertNotNull(exc);
        assertNotNull(exc.getLogfileId().getChangeset());
        assertEquals(Long.toString(exc.getLogfileId().getChangeset(), 16), "76d51071af8a");
    }
View Full Code Here

        list = perUtils.findExceptionsBySimilarLines(justDup1, true);
        assertEquals(1, list.size());
        List<Exceptions> all = PersistenceUtils.getAll(em, Exceptions.class);

        assertTrue(all.size() >= 2);
        Exceptions latest = all.get(all.size() - 1);
        latest.setReportId(all.get(all.size() - 2).getReportId());
        em.merge(latest);
        em.getTransaction().commit();
        em.getTransaction().begin();

        list = perUtils.findExceptionsBySimilarLines(substring, true);
View Full Code Here

TOP

Related Classes of org.netbeans.modules.exceptions.entity.Exceptions

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.