JDK-4905765 : Array type descriptor may have more than 255 dimensions
  • Type: Bug
  • Component: specification
  • Sub-Component: vm
  • Affected Version: unknown
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2003-08-13
  • Updated: 2014-03-28
  • Resolved: 2007-07-12
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6 1.6Fixed
Related Reports
Relates :  
Description

Name: vrR10176			Date: 08/13/2003



JVMS-2 has the assertions about array dimensions:

"4.10 Limitations of the Java Virtual Machine
...
The number of dimensions in an array is limited to 255 by the size of 
the dimensions opcode of the multianewarray instruction and by the 
constraints imposed on the multianewarray, anewarray, and newarray 
instructions by ?4.8.2.
..."

and

"4.4.1 The CONSTANT_Class_info Structure
...
An array type descriptor is valid only if it represents 255 or fewer dimensions."
It looks like the last assertion is applied to the chapter 4.4.1 only.

But the chapters: 
 2.7.5 Fully Qualified Names
 4.2 The Internal Form of Fully Qualified Class and Interface Names
 4.3 Descriptors (4.3.2 Field Descriptors and 4.3.3 Method Descriptors)
say nothing about a number of dimensions limitation. 

Further, the following chapters:
 4.4.6 The CONSTANT_NameAndType_info Structure 
 4.5 Fields
 4.6 Methods
refer to definitions of field descriptors and method descriptors
(descriptor_index) and also say nothing about a dimensions limitation. 

So according to JVMS-2 the descriptor_index of CONSTANT_NameAndType_info,
field_info or method_info structures may refer to field descriptor representing
more than 255 dimensions or method descriptor with similar ParameterDescriptor
or ReturnDescriptor.

======================================================================

Comments
EVALUATION Placing the requirement on array type descriptors in CONSTANT_Class_info was inadequate. JVMS 3ed moves the requirement to the Field Descriptors section. Method descriptors rely on field descriptors. Overall, the descriptor_index items of CONSTANT_NameAndType_info, field_info and method_info are now appropriately constrained.
12-07-2007

EVALUATION The spec is not totally clear on this. Will fix in 3rd edition/JSR202 draft. ###@###.### 2003-08-20
20-08-2003