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:
parent
628266af60
commit
98eae6dade
@ -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.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -108,7 +108,7 @@ import java.util.Arrays;
|
|||||||
* pattform.setFormats(testFormats);
|
* pattform.setFormats(testFormats);
|
||||||
* Object[] testArgs = {null, "ADisk", null};
|
* Object[] testArgs = {null, "ADisk", null};
|
||||||
* for (int i = 0; i < 4; ++i) {
|
* for (int i = 0; i < 4; ++i) {
|
||||||
* testArgs[0] = new Integer(i);
|
* testArgs[0] = Integer.valueOf(i);
|
||||||
* testArgs[2] = testArgs[0];
|
* testArgs[2] = testArgs[0];
|
||||||
* System.out.println(pattform.format(testArgs));
|
* System.out.println(pattform.format(testArgs));
|
||||||
* }
|
* }
|
||||||
|
@ -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.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -249,7 +249,7 @@ import java.util.Locale;
|
|||||||
* <blockquote><pre>
|
* <blockquote><pre>
|
||||||
* int fileCount = 1273;
|
* int fileCount = 1273;
|
||||||
* String diskName = "MyDisk";
|
* String diskName = "MyDisk";
|
||||||
* Object[] testArgs = {new Long(fileCount), diskName};
|
* Object[] testArgs = {Long.valueOf(fileCount), diskName};
|
||||||
*
|
*
|
||||||
* MessageFormat form = new MessageFormat(
|
* MessageFormat form = new MessageFormat(
|
||||||
* "The disk \"{1}\" contains {0} file(s).");
|
* "The disk \"{1}\" contains {0} file(s).");
|
||||||
@ -275,7 +275,7 @@ import java.util.Locale;
|
|||||||
*
|
*
|
||||||
* int fileCount = 1273;
|
* int fileCount = 1273;
|
||||||
* String diskName = "MyDisk";
|
* String diskName = "MyDisk";
|
||||||
* Object[] testArgs = {new Long(fileCount), diskName};
|
* Object[] testArgs = {Long.valueOf(fileCount), diskName};
|
||||||
*
|
*
|
||||||
* System.out.println(form.format(testArgs));
|
* System.out.println(form.format(testArgs));
|
||||||
* </pre></blockquote>
|
* </pre></blockquote>
|
||||||
@ -307,12 +307,11 @@ import java.util.Locale;
|
|||||||
* will be the final result of the parsing. For example,
|
* will be the final result of the parsing. For example,
|
||||||
* <blockquote><pre>
|
* <blockquote><pre>
|
||||||
* MessageFormat mf = new MessageFormat("{0,number,#.##}, {0,number,#.#}");
|
* 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 );
|
* String result = mf.format( objs );
|
||||||
* // result now equals "3.14, 3.1"
|
* // result now equals "3.14, 3.1"
|
||||||
* objs = null;
|
|
||||||
* objs = mf.parse(result, new ParsePosition(0));
|
* objs = mf.parse(result, new ParsePosition(0));
|
||||||
* // objs now equals {new Double(3.1)}
|
* // objs now equals {Double.valueOf(3.1)}
|
||||||
* </pre></blockquote>
|
* </pre></blockquote>
|
||||||
*
|
*
|
||||||
* <p>
|
* <p>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user