Skip to content

Commit 77ed0e5

Browse files
authored
Merge pull request #320 from szarnyasg/InternalRecord_hashCode
Rename hashcode method to hashCode to override Object.hashCode()
2 parents c4d5fc9 + 52a2cea commit 77ed0e5

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

driver/src/main/java/org/neo4j/driver/internal/InternalRecord.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public class InternalRecord extends InternalMapAccessorWithDefaultValue implemen
4141
{
4242
private final List<String> keys;
4343
private final Value[] values;
44-
private int hashcode = 0;
44+
private int hashCode = 0;
4545

4646
public InternalRecord( List<String> keys, Value[] values )
4747
{
@@ -132,6 +132,7 @@ public String toString()
132132
return format( "Record<%s>", formatPairs( InternalValue.Format.VALUE_ONLY, asMap( ofValue() ) ) );
133133
}
134134

135+
@Override
135136
public boolean equals( Object other )
136137
{
137138
if ( this == other )
@@ -167,12 +168,13 @@ else if ( other instanceof Record )
167168
}
168169
}
169170

170-
public int hashcode()
171+
@Override
172+
public int hashCode()
171173
{
172-
if ( hashcode == 0 )
174+
if ( hashCode == 0 )
173175
{
174-
hashcode = 31 * keys.hashCode() + Arrays.hashCode( values );
176+
hashCode = 31 * keys.hashCode() + Arrays.hashCode( values );
175177
}
176-
return hashcode;
178+
return hashCode;
177179
}
178180
}

driver/src/main/java/org/neo4j/driver/v1/Record.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,4 @@ public interface Record extends MapAccessorWithDefaultValue
129129
*/
130130
List<Pair<String, Value>> fields();
131131

132-
// Force implementation
133-
@Override
134-
boolean equals( Object other );
135-
136-
// Force implementation
137-
@Override
138-
int hashCode();
139132
}

0 commit comments

Comments
 (0)