mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8269665: Clean-up toString() methods of some primitive wrappers
Reviewed-by: redestad
This commit is contained in:
parent
7cc1eb3e57
commit
72145f3b94
4 changed files with 13 additions and 9 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1994, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1994, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -205,7 +205,7 @@ public final class Boolean implements java.io.Serializable,
|
|||
* @since 1.4
|
||||
*/
|
||||
public static String toString(boolean b) {
|
||||
return b ? "true" : "false";
|
||||
return String.valueOf(b);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -216,8 +216,9 @@ public final class Boolean implements java.io.Serializable,
|
|||
*
|
||||
* @return a string representation of this object.
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return value ? "true" : "false";
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue