Skip to content

Commit e5ecbff

Browse files
committedJul 18, 2023
8312203: Improve specification of Array.newInstance
Reviewed-by: bpb, mchung
1 parent c2f421b commit e5ecbff

File tree

1 file changed

+3
-5
lines changed
  • src/java.base/share/classes/java/lang/reflect

1 file changed

+3
-5
lines changed
 

‎src/java.base/share/classes/java/lang/reflect/Array.java

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1996, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -49,13 +49,11 @@ private Array() {}
4949
/**
5050
* Creates a new array with the specified component type and
5151
* length.
52+
* @implSpec
5253
* Invoking this method is equivalent to creating an array
5354
* as follows:
5455
* <blockquote>
55-
* <pre>
56-
* int[] x = {length};
57-
* Array.newInstance(componentType, x);
58-
* </pre>
56+
* {@code Array.newInstance(componentType, new int[]{length});}
5957
* </blockquote>
6058
*
6159
* <p>The number of dimensions of the new array must not

0 commit comments

Comments
 (0)
Please sign in to comment.