Skip to content

Commit 4aab58b

Browse files
committed
8335637: Add explicit non-null return value expectations to Object.toString()
Reviewed-by: jpai Backport-of: 66db715
1 parent 5b9ecb1 commit 4aab58b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/java.base/share/classes/java/lang/Object.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,10 @@ public boolean equals(Object obj) {
237237

238238
/**
239239
* {@return a string representation of the object}
240+
*
241+
* Satisfying this method's contract implies a non-{@code null}
242+
* result must be returned.
243+
*
240244
* @apiNote
241245
* In general, the
242246
* {@code toString} method returns a string that

0 commit comments

Comments
 (0)