Skip to content

Bug in preliminary MoveElse #60

@ibbem

Description

@ibbem

During refactoring for #59 I found the following possible bug in preliminary/pattern/semantic/MoveElse.java. I did not test if this is actually a bug, but I'm pretty sure.

The following lines (38-42 on 93f836e)

Collection<DiffNode> commonAddElse = annotationNode.getAllChildren();
commonAddElse.retainAll(annotationNode.getParent(AFTER).getAllChildren());

Collection<DiffNode> commonRemElse = removedElse.getAllChildren();
commonRemElse.retainAll(annotationNode.getParent(AFTER).getAllChildren());

modify the collection returned by DiffNode.getAllChildren by using Collection.retainAll. The problem is that DiffNode.getAllChildren returns an unmodifiable collection since 0a4b318. Therefore this will result in an UnsupportedOperationException exception.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingminor

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions