Skip to content

Commit 8e6dd4c

Browse files
author
Zhen Li
committed
Address PR review
1 parent 1b1f503 commit 8e6dd4c

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ public int hashCode()
196196
public String toString()
197197
{
198198
// print the duration in iso standard format.
199-
if ( this == ZERO )
199+
if ( this.equals( ZERO ) )
200200
{
201201
return "PT0S"; // no need to allocate a string builder if we know the result
202202
}

driver/src/test/java/org/neo4j/driver/internal/InternalIsoDurationTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ public void shouldCreateFromDuration()
156156
@Test
157157
public void toStringShouldPrintInIsoStandardFormat() throws Throwable
158158
{
159+
assertThat( new InternalIsoDuration( 0, 0, 0, 0 ).toString(), equalTo( "PT0S" ) );
159160
assertThat( new InternalIsoDuration( Period.parse( "P356D" ) ).toString(), equalTo( "P50W6D" ) );
160161
assertThat( new InternalIsoDuration( Duration.parse( "PT45S" ) ).toString(), equalTo( "PT45S" ) );
161162

0 commit comments

Comments
 (0)