Package org.netbeans.modules.exceptions.entity

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


        comp = match(matcher, new StackTraceElement[]{
                    new StackTraceElement("org.openide.util.lookup.SimpleLookup", "<init>", "file", 45)
                });
        assertNotNull(comp);//no Innocent

        perUtils.persist(new InnocentClass("org.openide.util.lookup")); // look up is innocent
        matcher.reload();

        comp = match(matcher, new StackTraceElement[]{
                    new StackTraceElement("org.openide.util.lookup.InstanceContent$SimpleItem", "<init>", "file", 45)
                });
View Full Code Here


        }
        return new Components(newComponents);
    }

    public static void setUpInnocents(EntityManager em){
        em.persist(new InnocentClass("org.openide.filesystems.FileUtil"));
        em.persist(new InnocentClass("URLMapper"));
        em.persist(new InnocentClass("org.netbeans.core.TimableEventQueue"));
        em.persist(new InnocentClass("org.netbeans.api.java.source"));
        em.persist(new InnocentClass("org.netbeans.api.java.classpath"));
        em.persist(new InnocentClass("org.netbeans.modules.java.source"));
        em.persist(new InnocentClass("org.netbeans.modules.java.classpath"));
    }
View Full Code Here

    }

    @Test
    public void testSuspicious() throws IOException {
        setUp("snapshot.nps");
        perUtils.persist(new InnocentClass("org.netbeans.core.TimableEventQueue"));
        Matcher.getDefault().reload();
        List<MethodItem> ml = sm.getSuspiciousStackPrefix();
        assertEquals(62, ml.size());
        assertEquals("java.awt.EventDispatchThread.pumpEvents", ml.get(1).getMethodName());
        assertEquals("org.openide.nodes.ChildrenArray.nodesFor", ml.get(ml.size() - 1).getMethodName());
View Full Code Here

    }

    @Test
    public void testComponent() throws IOException{
        setUp("res/viewmodel_component.nps");
        perUtils.persist(new InnocentClass("org.netbeans.core.TimableEventQueue"));
        Matcher.getDefault().reload();
        EntityManager em = perUtils.createEntityManager();
        em.getTransaction().begin();
        Component comp = sm.getComponent(em);
        em.getTransaction().commit();
        em.close();
        assertEquals("java and loader classes are ignored", new Component("debuggercore", "code"), comp);

        em = perUtils.createEntityManager();
        em.getTransaction().begin();
        em.persist(new InnocentClass("org.openide.filesystems.FileUtil"));
        em.persist(new InnocentClass("URLMapper"));
        em.getTransaction().commit();
        em.close();
        Matcher.getDefault().reload();

        setUp("res/url_mapper.nps");
View Full Code Here

    }

    @Test
    public void testIssue169810() throws IOException{
        setUp("res/issue169810.nps");
        perUtils.persist(new InnocentClass("org.netbeans.core.TimableEventQueue"));
        Matcher.getDefault().reload();
        EntityManager em = perUtils.createEntityManager();
        em.getTransaction().begin();
        Component comp = sm.getComponent(em);
        em.getTransaction().commit();
View Full Code Here

    }

    @Test
    public void testIgnoredCloneableEditor() throws IOException{
        setUp("res/cloneable_editor.nps");
        perUtils.persist(new InnocentClass("org.openide.text.CloneableEditor"));
        Matcher.getDefault().reload();
        EntityManager em = perUtils.createEntityManager();
        em.getTransaction().begin();
        Component comp = sm.getComponent(em);
        em.getTransaction().commit();
View Full Code Here

            public TransactionResult runQuery(EntityManager em) {
                if (newClassName != null) {
                    Object result = PersistenceUtils.executeNamedQuerySingleResult(em,
                            "InnocentClass.findByClassname", Collections.singletonMap("classname", (Object) newClassName));
                    if (result == null) {
                        InnocentClass newInnocent = new InnocentClass(newClassName);
                        em.persist(newInnocent);
                    }
                } else if (drop != null) {
                    InnocentClass removedClass = em.find(InnocentClass.class, drop);
                    em.remove(removedClass);
                }
                request.setAttribute("innocents", PersistenceUtils.getAll(em, InnocentClass.class));
                return TransactionResult.COMMIT;
View Full Code Here

TOP

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

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.