mirror of
https://github.com/corda/corda.git
synced 2025-01-19 03:06:36 +00:00
Fix getClass().getComponentType() for higher-dimensional arrays
When creating an object array with more than two dimensions, the component type was erroneously set to the base type, not the array type of one less dimension. This prevented Collection<Class[]>#toArray(Class[][]) from working properly. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
parent
187d5dfde9
commit
0ca8601777
@ -2512,7 +2512,11 @@ makeArrayClass(Thread* t, object loader, object spec, bool throw_,
|
||||
++ s;
|
||||
const char* elementSpecStart = s;
|
||||
while (*s and *s != ';') ++ s;
|
||||
|
||||
if (dimensions > 1) {
|
||||
elementSpecStart -= dimensions;
|
||||
++ s;
|
||||
}
|
||||
|
||||
elementSpec = makeByteArray(t, s - elementSpecStart + 1);
|
||||
memcpy(&byteArrayBody(t, elementSpec, 0),
|
||||
&byteArrayBody(t, spec, elementSpecStart - start),
|
||||
|
Loading…
Reference in New Issue
Block a user