mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8299500: Usage of constructors of primitive wrapper classes should be avoided in java.text API docs
Reviewed-by: naoto, lancea
This commit is contained in:
parent
bfd5971429
commit
cd10c7278d
2 changed files with 7 additions and 8 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1996, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1996, 2023, 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
|
||||
|
@ -249,7 +249,7 @@ import java.util.Locale;
|
|||
* <blockquote><pre>
|
||||
* int fileCount = 1273;
|
||||
* String diskName = "MyDisk";
|
||||
* Object[] testArgs = {new Long(fileCount), diskName};
|
||||
* Object[] testArgs = {Long.valueOf(fileCount), diskName};
|
||||
*
|
||||
* MessageFormat form = new MessageFormat(
|
||||
* "The disk \"{1}\" contains {0} file(s).");
|
||||
|
@ -275,7 +275,7 @@ import java.util.Locale;
|
|||
*
|
||||
* int fileCount = 1273;
|
||||
* String diskName = "MyDisk";
|
||||
* Object[] testArgs = {new Long(fileCount), diskName};
|
||||
* Object[] testArgs = {Long.valueOf(fileCount), diskName};
|
||||
*
|
||||
* System.out.println(form.format(testArgs));
|
||||
* </pre></blockquote>
|
||||
|
@ -307,12 +307,11 @@ import java.util.Locale;
|
|||
* will be the final result of the parsing. For example,
|
||||
* <blockquote><pre>
|
||||
* MessageFormat mf = new MessageFormat("{0,number,#.##}, {0,number,#.#}");
|
||||
* Object[] objs = {new Double(3.1415)};
|
||||
* Object[] objs = {Double.valueOf(3.1415)};
|
||||
* String result = mf.format( objs );
|
||||
* // result now equals "3.14, 3.1"
|
||||
* objs = null;
|
||||
* objs = mf.parse(result, new ParsePosition(0));
|
||||
* // objs now equals {new Double(3.1)}
|
||||
* // objs now equals {Double.valueOf(3.1)}
|
||||
* </pre></blockquote>
|
||||
*
|
||||
* <p>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue