{"action":"opened","issue":{"url":"https://api.github.com/repos/h2database/h2database/issues/1420","repository_url":"https://api.github.com/repos/h2database/h2database","labels_url":"https://api.github.com/repos/h2database/h2database/issues/1420/labels{/name}","comments_url":"https://api.github.com/repos/h2database/h2database/issues/1420/comments","events_url":"https://api.github.com/repos/h2database/h2database/issues/1420/events","html_url":"https://github.com/h2database/h2database/issues/1420","id":357089120,"node_id":"MDU6SXNzdWUzNTcwODkxMjA=","number":1420,"title":"Exception: Unable to cast int[] to Object[] during call ValueArray.getObject ","user":{"login":"tamnm","id":311621,"node_id":"MDQ6VXNlcjMxMTYyMQ==","avatar_url":"https://avatars0.githubusercontent.com/u/311621?v=4","gravatar_id":"","url":"https://api.github.com/users/tamnm","html_url":"https://github.com/tamnm","followers_url":"https://api.github.com/users/tamnm/followers","following_url":"https://api.github.com/users/tamnm/following{/other_user}","gists_url":"https://api.github.com/users/tamnm/gists{/gist_id}","starred_url":"https://api.github.com/users/tamnm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tamnm/subscriptions","organizations_url":"https://api.github.com/users/tamnm/orgs","repos_url":"https://api.github.com/users/tamnm/repos","events_url":"https://api.github.com/users/tamnm/events{/privacy}","received_events_url":"https://api.github.com/users/tamnm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-05T06:53:19Z","updated_at":"2018-09-05T06:53:19Z","closed_at":null,"author_association":"NONE","body":"When I tried with a int[] column, I got exception at this line.\r\n\r\n```java\r\npublic Object getObject() {\r\n        int len = values.length;\r\n        Object[] list = (Object[]) Array.newInstance(componentType, len); \r\n       //!!!!The upper will throw exception when component Type is value type like int\r\n        for (int i = 0; i < len; i++) {\r\n            final Value value = values[i];\r\n            if (!SysProperties.OLD_RESULT_SET_GET_OBJECT) {\r\n                final int type = value.getType();\r\n                if (type == Value.BYTE || type == Value.SHORT) {\r\n                    list[i] = value.getInt();\r\n                    continue;\r\n                }\r\n            }\r\n            list[i] = value.getObject();\r\n        }\r\n        return list;\r\n}\r\n```\r\n\r\nI think we could use `java.lang.reflect.Array;` here"}}
{"actor":{"display_login":"tamnm"}}