Skip to content

Commit

Permalink
Fix failing ClusterIndexProcedureIT.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisvest committed Aug 9, 2018
1 parent d61c3be commit 25afbe8
Showing 1 changed file with 9 additions and 4 deletions.
Expand Up @@ -145,6 +145,11 @@ public boolean isConstraintIndex()
public boolean isNodeIndex()
{
assertInUnterminatedTransaction();
return internalIsNodeIndex();
}

private boolean internalIsNodeIndex()
{
return labels != null;
}

Expand All @@ -159,7 +164,7 @@ public boolean isRelationshipIndex()
public boolean isMultiTokenIndex()
{
assertInUnterminatedTransaction();
return labels != null ? labels.length > 1 : relTypes.length > 1;
return internalIsNodeIndex() ? labels.length > 1 : relTypes.length > 1;
}

@Override
Expand All @@ -174,7 +179,7 @@ public int hashCode()
{
HashFunction hf = HashFunction.incrementalXXH64();
long hash = hf.initialise( 31 );
if ( labels != null )
if ( internalIsNodeIndex() )
{
hash = hf.update( hash, 42 ); // labels-array specific discriminator.
hash = hf.update( hash, labels.length );
Expand Down Expand Up @@ -216,7 +221,7 @@ public boolean equals( Object obj )
return false;
}
IndexDefinitionImpl other = (IndexDefinitionImpl) obj;
if ( labels != null )
if ( internalIsNodeIndex() )
{
if ( other.labels == null )
{
Expand Down Expand Up @@ -260,7 +265,7 @@ public String toString()
{
String entityTokenType;
String entityTokens;
if ( isNodeIndex() )
if ( internalIsNodeIndex() )
{
entityTokenType = labels.length > 1 ? "labels" : "label";
entityTokens = Arrays.stream( labels ).map( Label::name ).collect( joining( "," ) );
Expand Down

0 comments on commit 25afbe8

Please sign in to comment.