Package ch.uzh.ifi.seal.changedistiller.model.entities

Examples of ch.uzh.ifi.seal.changedistiller.model.entities.ClassHistory


    @Test
    public void changedFilesShouldProduceClassHistories() throws Exception {
        File left = CompilationUtils.getFile(TEST_DATA + "TestLeft.java");
        File right = CompilationUtils.getFile(TEST_DATA + "TestRight.java");
        distiller.extractClassifiedSourceCodeChanges(left, right);
        ClassHistory classHistory = distiller.getClassHistory();
        assertThat(classHistory.getAttributeHistories().size(), is(3));
        assertThat(classHistory.getMethodHistories().size(), is(1));
        assertThat(classHistory.getInnerClassHistories().size(), is(1));
        classHistory = classHistory.getInnerClassHistories().values().iterator().next();
        assertThat(classHistory.getUniqueName(), is("test.Test.Bar"));
        assertThat(classHistory.getMethodHistories().size(), is(1));
        String k = classHistory.getMethodHistories().keySet().iterator().next();
        assertThat(classHistory.getMethodHistories().get(k).getUniqueName(), is("test.Test.Bar.newMethod()"));
    }
View Full Code Here


    private void processRootChildren(StructureDiffNode diffNode) {
        for (StructureDiffNode child : diffNode.getChildren()) {
            if (child.isClassOrInterfaceDiffNode() && mayHaveChanges(child.getLeft(), child.getRight())) {
                if (fClassHistory == null) {
                  if (fVersion != null) {
                    fClassHistory = new ClassHistory(fRightASTHelper.createStructureEntityVersion(child.getRight(), fVersion));
                  } else {
                    fClassHistory = new ClassHistory(fRightASTHelper.createStructureEntityVersion(child.getRight()));
                  }
                }
                processClassDiffNode(child);
            }
        }
View Full Code Here

        cleanupInnerClassHistories();
    }

    private void cleanupInnerClassHistories() {
        for (Iterator<ClassHistory> it = fClassHistory.getInnerClassHistories().values().iterator(); it.hasNext();) {
            ClassHistory ch = it.next();
            if (!ch.hasChanges()) {
                it.remove();
            }
        }
    }
View Full Code Here

    }

    private void processClassDiffNode(StructureDiffNode diffNode) {
      ClassDistiller classDistiller;
      if (fVersion != null) {
        ClassHistory classHistory = fClassHistory.createInnerClassHistory(fLeftASTHelper.createStructureEntityVersion(diffNode.getLeft(), fVersion));
        classDistiller =
                new ClassDistiller(
                        diffNode,
                        classHistory,
                        fLeftASTHelper,
                        fRightASTHelper,
                        fRefactoringProcessor,
                        fDistillerFactory,
                        fVersion);
      } else {
        ClassHistory classHistory = fClassHistory.createInnerClassHistory(fLeftASTHelper.createStructureEntityVersion(diffNode.getLeft()));
        classDistiller =
                new ClassDistiller(
                        diffNode,
                        classHistory,
                        fLeftASTHelper,
View Full Code Here

    }

    @Override
    public StructureEntityVersion createInnerClassInClassHistory(ClassHistory classHistory, JavaStructureNode node, String versionNum) {
        ClassHistory ch = null;
        StructureEntityVersion clazz = createStructureEntityVersion(node, versionNum);
        if (classHistory.getInnerClassHistories().containsKey(clazz.getUniqueName())) {
            ch = classHistory.getInnerClassHistories().get(clazz.getUniqueName());
            ch.addVersion(clazz);
        } else {
            ch = new ClassHistory(clazz);
            classHistory.getInnerClassHistories().put(clazz.getUniqueName(), ch);
        }
        return clazz;

    }
View Full Code Here

    }
   
    @Override
    public StructureEntityVersion createInnerClassInClassHistory(ClassHistory classHistory, JavaStructureNode node) {
        ClassHistory ch = null;
        StructureEntityVersion clazz = createStructureEntityVersion(node);
        if (classHistory.getInnerClassHistories().containsKey(clazz.getUniqueName())) {
            ch = classHistory.getInnerClassHistories().get(clazz.getUniqueName());
            ch.addVersion(clazz);
        } else {
            ch = new ClassHistory(clazz);
            classHistory.getInnerClassHistories().put(clazz.getUniqueName(), ch);
        }
        return clazz;

    }
View Full Code Here

TOP

Related Classes of ch.uzh.ifi.seal.changedistiller.model.entities.ClassHistory

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.