Package org.netbeans.modules.exceptions.entity

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


    }

    private Component getComponentFromSourceJar(EntityManager em, StackTraceElement stackTraceElement) {
        SourcejarMapping bestMapping = null;
        String methodName = Method.getMethodNameFromSTE(stackTraceElement);
        Method method = (Method) PersistenceUtils.getExist(em, "Method.findByName", methodName);
        if ((method != null) && (method.getSourcejar() != null)){
            for (SourcejarMapping mapping: mappings){
                if (!mapping.matches(method.getSourcejar())){
                    continue;
                }
                if ((bestMapping == null) || (mapping.getSourcejar().length() > bestMapping.getSourcejar().length())){
                    bestMapping = mapping;
                }
View Full Code Here


        if (sj == null) {
            sj = new Sourcejar(jarName.hashCode());
        }
        sj.setName(jarName);
        em.persist(sj);
        Method m = new Method(methodName.hashCode());
        m.setSourcejar(sj);
        m.setName(methodName);
        em.persist(m);
        em.getTransaction().commit();
    }
View Full Code Here

    }

    @Override
    protected Submit createSubmit(int id) {
        Slowness result = new Slowness(id);
        Method m = new Method(Utils.getNextId(Method.class));
        m.setName("test" + m.getId());
        em.persist(m);
        result.setSuspiciousMethod(m);
        return result;
    }
View Full Code Here

        addLog(log, "NB2040811605");
        refreshEM();
        Map<String, Object> params = Collections.singletonMap("name", (Object)"java.awt.EventDispatchThread.pumpEvents");
        List<Method> methods = PersistenceUtils.executeNamedQuery(em, "Method.findByName", params, Method.class);
        assertEquals(1, methods.size());
        Method method = methods.get(0);
        assertNotNull(method.getSourcejar());
        assertEquals("rt.jar", method.getSourcejar().getName());

        params = Collections.singletonMap("name", (Object)"org.openide.loaders.FolderInstance.defaultProcessObjects");
        refreshEM();
        methods = PersistenceUtils.executeNamedQuery(em, "Method.findByName", params, Method.class);
        assertEquals(1, methods.size());
        method = methods.get(0);
        assertNull(method.getSourcejar());

        log = LogsManagerTest.extractResourceAs(data, "dup2834", "NB2040811605.1");
        addLog(log, "NB2040811605");
        refreshEM();
        methods = PersistenceUtils.executeNamedQuery(em, "Method.findByName", params, Method.class);
        assertEquals(1, methods.size());
        method = methods.get(0);
        assertNotNull(method.getSourcejar());
        assertEquals("org-openide-loaders.jar", method.getSourcejar().getName());
     }
View Full Code Here

        log.setProductVersionId(pv);
        Nbuser user = new Nbuser(1);
        user.setName("HALLO");
        Slowness slown = new Slowness(100);
        slown.setActionTime(1000L);
        Method m = new Method(30);
        m.setName("unknown");
        Report report = new Report(100);
        slown.setSuspiciousMethod(m);
        slown.setReportId(report);
        slown.setLogfileId(log);
        report.setComponent("user.dir");
View Full Code Here

        Submit sbm;
        if (id%2 == 0){
             sbm = new Exceptions(id);
        }else{
            Slowness slown = new Slowness(id);
            Method m = new Method(id);
            m.setName("hallo" + id);
            em.persist(m);
            slown.setSuspiciousMethod(m);
            sbm = slown;
        }
        Report report = new Report(id);
View Full Code Here

    @Override
    protected void setUp() throws Exception {
        super.setUp();
        em = perUtils.createEntityManager();
        em.getTransaction().begin();
        m = new Method(1);
        m.setName("bla bla");
        em.persist(m);
        r1 = new Report(1);
        r2 = new Report(2);
        em.persist(r1);
View Full Code Here

        Stacktrace st2 = new Stacktrace(2);
        exc.setStacktrace(st);
        st.setAnnotation(st2);
        st.setMessage("st");
        st.setLineCollection(Collections.<Line>emptyList());
        Method m1 = new Method(1);
        m1.setName("test1");
        Method m2 = new Method(2);
        m2.setName("test2");
        Line l1 = new Line(1,1,3,1);
        Line l2 = new Line(1,1,3,2);
        Line l3 = new Line(1,1,3,3);
        Line l4 = new Line(1,1,3,4);
        l1.setMethod(m1);
View Full Code Here

        r.setComponent("ide");
        r.setSubcomponent("Code");
        em.persist(r);
        Submit sbm;
        if (isSlowness) {
            Method m = new Method(i);
            m.setName("test" + i);
            em.persist(m);

            Slowness slowness = new Slowness(i);
            slowness.setActionTime(Long.valueOf(i));
            slowness.setSuspiciousMethod(m);
View Full Code Here

TOP

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

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.