Skip to content

Handling of multidimensional arrays #2

@gkastrinis

Description

@gkastrinis

Maybe I am doing something wrong but I think the following behavior is a bug.

I have this file

cat -n Test1.java 
     1  import java.lang.reflect.Array;
     2
     3  public class Test1
     4  {
     5    public static void main(String[] ps) {
     6                  Test1[] single = (Test1[]) Array.newInstance(Test1.class, 3);
     7
     8                  int[] sizes = {3, 5, 4};
     9                  Test1[][][] multi = (Test1[][][]) Array.newInstance(Test1.class, sizes);
    10                  System.out.println(multi[0].length);
    11    }
    12 

And using the poa jar I get among others the following

Array.newInstance;Test1;Test1.main;9;;
Array.newInstance;Test1[];Test1.main;6;;

Is the entry for line 9 a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions