8299500: Usage of constructors of primitive wrapper classes should be avoided in java.text API docs

Reviewed-by: iris
Backport-of: cd10c7278d8fcf7ce6713a3ee688bb1e10c024f6
This commit is contained in:
Justin Lu 2023-01-13 23:16:48 +00:00 committed by Naoto Sato
parent 628266af60
commit 98eae6dade
2 changed files with 7 additions and 8 deletions

View File

@ -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
@ -108,7 +108,7 @@ import java.util.Arrays;
* pattform.setFormats(testFormats);
* Object[] testArgs = {null, "ADisk", null};
* for (int i = 0; i < 4; ++i) {
* testArgs[0] = new Integer(i);
* testArgs[0] = Integer.valueOf(i);
* testArgs[2] = testArgs[0];
* System.out.println(pattform.format(testArgs));
* }

View File

@ -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>