{"action":"closed","issue":{"url":"https://api.github.com/repos/ceylon/ceylon/issues/6462","repository_url":"https://api.github.com/repos/ceylon/ceylon","labels_url":"https://api.github.com/repos/ceylon/ceylon/issues/6462/labels{/name}","comments_url":"https://api.github.com/repos/ceylon/ceylon/issues/6462/comments","events_url":"https://api.github.com/repos/ceylon/ceylon/issues/6462/events","html_url":"https://github.com/ceylon/ceylon/issues/6462","id":174093268,"number":6462,"title":"unmaintained invariants in AbstractArrayIterable => runtime error","user":{"login":"jvasileff","id":236050,"avatar_url":"https://avatars.githubusercontent.com/u/236050?v=3","gravatar_id":"","url":"https://api.github.com/users/jvasileff","html_url":"https://github.com/jvasileff","followers_url":"https://api.github.com/users/jvasileff/followers","following_url":"https://api.github.com/users/jvasileff/following{/other_user}","gists_url":"https://api.github.com/users/jvasileff/gists{/gist_id}","starred_url":"https://api.github.com/users/jvasileff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jvasileff/subscriptions","organizations_url":"https://api.github.com/users/jvasileff/orgs","repos_url":"https://api.github.com/users/jvasileff/repos","events_url":"https://api.github.com/users/jvasileff/events{/privacy}","received_events_url":"https://api.github.com/users/jvasileff/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ceylon/ceylon/labels/runtime-jvm","name":"runtime-jvm","color":"0052cc"},{"url":"https://api.github.com/repos/ceylon/ceylon/labels/t-bug","name":"t-bug","color":"e10c02"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/ceylon/ceylon/milestones/15","html_url":"https://github.com/ceylon/ceylon/milestones/1.3.0","labels_url":"https://api.github.com/repos/ceylon/ceylon/milestones/15/labels","id":1590811,"number":15,"title":"1.3.0","description":"","creator":{"login":"FroMage","id":179265,"avatar_url":"https://avatars.githubusercontent.com/u/179265?v=3","gravatar_id":"","url":"https://api.github.com/users/FroMage","html_url":"https://github.com/FroMage","followers_url":"https://api.github.com/users/FroMage/followers","following_url":"https://api.github.com/users/FroMage/following{/other_user}","gists_url":"https://api.github.com/users/FroMage/gists{/gist_id}","starred_url":"https://api.github.com/users/FroMage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FroMage/subscriptions","organizations_url":"https://api.github.com/users/FroMage/orgs","repos_url":"https://api.github.com/users/FroMage/repos","events_url":"https://api.github.com/users/FroMage/events{/privacy}","received_events_url":"https://api.github.com/users/FroMage/received_events","type":"User","site_admin":false},"open_issues":11,"closed_issues":331,"state":"open","created_at":"2016-02-18T14:05:01Z","updated_at":"2016-08-30T22:37:12Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2016-08-30T18:39:01Z","updated_at":"2016-08-30T22:37:12Z","closed_at":"2016-08-30T22:37:12Z","body":"`AbstractArrayIterable.java` has:\r\n\r\n```java\r\n        if (len < 0) {\r\n            throw new AssertionError(\"len must be non-negative\");\r\n        }\r\n```\r\nbut also the following, which doesn't care about nagative lengths:\r\n```java\r\n    @Override\r\n    public AbstractArrayIterable<Element, ArrayType> \r\n    skip(long skip) {\r\n        if (skip <= 0) {\r\n            return this;\r\n        }\r\n        return newInstance(this.array, \r\n                this.start+(int)skip*this.step, \r\n                this.len-(int)skip, // **** oops, might be negative!\r\n                this.step);\r\n    }\r\n```\r\nthis results in:\r\n```ceylon\r\n    Array { 1 }.skip(1).skip(1);\r\n    // Exception in thread \"main\" ceylon.language.AssertionError \"len must be non-negative\"\r\n```\r\n`getSize()` does extra work given the invariant:\r\n```java\r\n    @Ignore\r\n    @Override\r\n    public long getSize() {\r\n        return Math.max(0, this.len);\r\n    }\r\n```\r\nNothing else jumps out at me, although I didn't look for places `AbstractArrayIterable` is used."}}
{"actor":{"display_login":"gavinking"}}