Examples of StructureEntityVersion


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

    }

    private void extractClassDeclarationChanges(String className) {
        Node leftDeclaration = convertClassDeclaration(className, fLeftSnippet);
        Node rootDeclaration = convertClassDeclaration(className, fRightSnippet);
        structureEntity = new StructureEntityVersion(JavaEntityType.CLASS, className, 0);
        distill(leftDeclaration, rootDeclaration);
    }
View Full Code Here

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

    }

    private void extractFieldDeclarationChanges(String fieldName) {
        Node leftDeclaration = convertFieldDeclaration(fieldName, fLeftSnippet);
        Node rootDeclaration = convertFieldDeclaration(fieldName, fRightSnippet);
        structureEntity = new StructureEntityVersion(JavaEntityType.FIELD, fieldName, 0);
        distill(leftDeclaration, rootDeclaration);
    }
View Full Code Here

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

    }

    private void extractMethodDeclarationChanges(String methodName) {
        Node leftDeclaration = convertMethodDeclaration(methodName, fLeftSnippet);
        Node rootDeclaration = convertMethodDeclaration(methodName, fRightSnippet);
        structureEntity = new StructureEntityVersion(JavaEntityType.METHOD, methodName, 0);
        distill(leftDeclaration, rootDeclaration);
    }
View Full Code Here

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

    }

    private void extractMethodChanges(String methodName) {
        Node leftMethod = convertMethodBody(methodName, fLeftSnippet);
        Node rightMethod = convertMethodBody(methodName, fRightSnippet);
        structureEntity = new StructureEntityVersion(JavaEntityType.METHOD, methodName, 0);
        distill(leftMethod, rightMethod);
    }
View Full Code Here

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

            processFineGrainedChanges(diffNode);
        }
    }

    private void processFineGrainedChanges(StructureDiffNode diffNode) {
      StructureEntityVersion entity;
      if (fVersion != null) {
        entity = fRightASTHelper.createStructureEntityVersion(diffNode.getRight(), fVersion);
      } else {
        entity = fRightASTHelper.createStructureEntityVersion(diffNode.getRight());
      }
        if (diffNode.isMethodOrConstructorDiffNode()) {
            entity = createMethodStructureEntity(diffNode);
        } else if (diffNode.isFieldDiffNode()) {
            entity = createFieldStructureEntity(diffNode);
        } else if (diffNode.isClassOrInterfaceDiffNode()) {
            entity = createInnerClassStructureEntity(diffNode);
        }
        processBodyChanges(diffNode, entity);
        processDeclarationChanges(diffNode, entity);
        if (!entity.getSourceCodeChanges().isEmpty()) {
            fChanges.addAll(entity.getSourceCodeChanges());
        } else {
            if (diffNode.isMethodOrConstructorDiffNode()) {
                fClassHistory.deleteMethod(entity);
            } else if (diffNode.isFieldDiffNode()) {
                fClassHistory.deleteAttribute(entity);
View Full Code Here

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

    @Test
    public void unchangedMethodDeclarationShouldNotHaveAnyChanges() throws Exception {
        JavaCompilation compilation = CompilationUtils.compileFile(TEST_DATA + "TestLeft.java");
        Node rootLeft = convertMethodDeclaration("foo", compilation);
        Node rootRight = convertMethodDeclaration("foo", compilation);
        StructureEntityVersion structureEntity = new StructureEntityVersion(JavaEntityType.METHOD, "foo", 0);
        Distiller distiller = getDistiller(structureEntity);
        distiller.extractClassifiedSourceCodeChanges(rootLeft, rootRight);
        assertThat(structureEntity.getSourceCodeChanges().isEmpty(), is(true));
    }
View Full Code Here

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

    public void changedMethodShouldHaveChanges() throws Exception {
        JavaCompilation compilationLeft = CompilationUtils.compileFile(TEST_DATA + "TestLeft.java");
        JavaCompilation compilationRight = CompilationUtils.compileFile(TEST_DATA + "TestRight.java");
        Node rootLeft = convertMethodDeclaration("foo", compilationLeft);
        Node rootRight = convertMethodDeclaration("foo", compilationRight);
        StructureEntityVersion structureEntity = new StructureEntityVersion(JavaEntityType.METHOD, "foo", 0);
        Distiller distiller = getDistiller(structureEntity);
        distiller.extractClassifiedSourceCodeChanges(rootLeft, rootRight);
        assertThat(structureEntity.getSourceCodeChanges().size(), is(2));
    }
View Full Code Here

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

    public void changedFieldShouldHaveChanges() throws Exception {
      JavaCompilation compilationLeft = CompilationUtils.compileFile(TEST_DATA + "TestLeft.java");
      JavaCompilation compilationRight = CompilationUtils.compileFile(TEST_DATA + "TestRight.java");
      Node rootLeft = convertFieldDeclaration("arrayField", compilationLeft);
      Node rootRight = convertFieldDeclaration("arrayField", compilationRight);
      StructureEntityVersion structureEntity = new StructureEntityVersion(JavaEntityType.FIELD, "arrayField", 0);
      Distiller distiller = getDistiller(structureEntity);
      distiller.extractClassifiedSourceCodeChanges(rootLeft, rootRight);
     
      List<SourceCodeChange> changes = structureEntity.getSourceCodeChanges();
      assertThat(changes.size(), is(1));
     
      SourceCodeChange singleChange = changes.get(0);
     
      if(singleChange instanceof Update) {
View Full Code Here

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

        return new SourceRange(astNode.sourceStart(), astNode.sourceEnd());
    }

    @Override
    public StructureEntityVersion createStructureEntityVersion(JavaStructureNode node, String versionNum) {
        return new StructureEntityVersion(
                convertType(node),
                node.getFullyQualifiedName(),
                extractModifier(node.getASTNode()),
                versionNum);
    }
View Full Code Here

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

                versionNum);
    }
   
    @Override
    public StructureEntityVersion createStructureEntityVersion(JavaStructureNode node) {
        return new StructureEntityVersion(
                convertType(node),
                node.getFullyQualifiedName(),
                extractModifier(node.getASTNode()));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.