Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing some typo on Expander interface and deprecating a method #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions kernel/src/main/java/org/neo4j/graphdb/Expander.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,17 @@ public interface Expander extends RelationshipExpander
/**
* Add a {@link Relationship} filter.
*
* @deprecated because of typo use {@link Expander#addRelationshipFilter(Predicate)} instead
* @param filter filter to use
* @return new instance
*/
Expander addRelationsipFilter( Predicate<? super Relationship> filter );

/**
* Add a {@link Relationship} filter.
*
* @param filter filter to use
* @return new instance
*/
Expander addRelationshipFilter( Predicate<? super Relationship> filter );
}
31 changes: 22 additions & 9 deletions kernel/src/main/java/org/neo4j/kernel/StandardExpander.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public StandardExpansion<T> filterNodes( Predicate<? super Node> filter )
public StandardExpansion<T> filterRelationships(
Predicate<? super Relationship> filter )
{
return createNew( expander.addRelationsipFilter( filter ) );
return createNew( expander.addRelationshipFilter( filter ) );
}

public T getSingle()
Expand Down Expand Up @@ -122,7 +122,7 @@ public StandardExpansion<Node> nodes()

public StandardExpansion<Relationship> relationships()
{
return new RelationsipExpansion( expander, start );
return new RelationshipExpansion( expander, start );
}

public StandardExpansion<Pair<Relationship, Node>> pairs()
Expand All @@ -131,10 +131,10 @@ public StandardExpansion<Pair<Relationship, Node>> pairs()
}
}

private static final class RelationsipExpansion extends
private static final class RelationshipExpansion extends
StandardExpansion<Relationship>
{
RelationsipExpansion( StandardExpander expander, Node start )
RelationshipExpansion( StandardExpander expander, Node start )
{
super( expander, start );
}
Expand All @@ -149,7 +149,7 @@ public String toString()
StandardExpansion<Relationship> createNew(
@SuppressWarnings( "hiding" ) StandardExpander expander )
{
return new RelationsipExpansion( expander, start );
return new RelationshipExpansion( expander, start );
}

@Override
Expand Down Expand Up @@ -664,8 +664,15 @@ public StandardExpander addNodeFilter( Predicate<? super Node> filter )
public StandardExpander addRelationsipFilter(
Predicate<? super Relationship> filter )
{
return new FilteringExpander( expander, append( filters,
new RelationshipFilter( filter ) ) );
return addRelationshipFilter(filter);
}

@Override
public StandardExpander addRelationshipFilter(
Predicate<? super Relationship> filter )
{
return new FilteringExpander( expander, append( filters,
new RelationshipFilter( filter ) ) );
}

@Override
Expand Down Expand Up @@ -878,7 +885,7 @@ boolean exclude( Node start, Relationship item )

public final Expansion<Relationship> expand( Node start )
{
return new RelationsipExpansion( this, start );
return new RelationshipExpansion( this, start );
}

static <T> T[] append( T[] array, T item )
Expand Down Expand Up @@ -960,7 +967,13 @@ public StandardExpander addNodeFilter( Predicate<? super Node> filter )
public StandardExpander addRelationsipFilter(
Predicate<? super Relationship> filter )
{
return new FilteringExpander( this, new RelationshipFilter( filter ) );
return addRelationshipFilter(filter);
}

public StandardExpander addRelationshipFilter(
Predicate<? super Relationship> filter )
{
return new FilteringExpander( this, new RelationshipFilter( filter ) );
}

static StandardExpander wrap( RelationshipExpander expander )
Expand Down