Skip to content

Commit

Permalink
delete -> remove
Browse files Browse the repository at this point in the history
  • Loading branch information
jlink committed Nov 9, 2015
1 parent 1d6a7d5 commit 80332bc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Expand Up @@ -53,7 +53,7 @@ protected void removeChild(AbstractTestDescriptor abstractTestDescriptor) {


protected void removeFromHierarchy() { protected void removeFromHierarchy() {
if (isRoot()) if (isRoot())
return; throw new UnsupportedOperationException("You cannot remove the root of a hierarchy.");
if (parent instanceof AbstractTestDescriptor) if (parent instanceof AbstractTestDescriptor)
((AbstractTestDescriptor) parent).removeChild(this); ((AbstractTestDescriptor) parent).removeChild(this);
setParent(null); setParent(null);
Expand All @@ -75,8 +75,8 @@ public final Set<TestDescriptor> getChildren() {


@Override @Override
public void accept(Visitor visitor) { public void accept(Visitor visitor) {
Runnable delete = () -> removeFromHierarchy(); Runnable remove = () -> removeFromHierarchy();
visitor.visit(this, delete); visitor.visit(this, remove);
new LinkedHashSet<>(getChildren()).forEach(child -> child.accept(visitor)); new LinkedHashSet<>(getChildren()).forEach(child -> child.accept(visitor));
} }


Expand Down
Expand Up @@ -44,7 +44,7 @@ default boolean isRoot() {


interface Visitor { interface Visitor {


void visit(TestDescriptor descriptor, Runnable deleteCurrent); void visit(TestDescriptor descriptor, Runnable remove);
} }


void accept(Visitor visitor); void accept(Visitor visitor);
Expand Down

0 comments on commit 80332bc

Please sign in to comment.