{"action":"opened","issue":{"url":"https://api.github.com/repos/kelloggm/checker-framework/issues/58","repository_url":"https://api.github.com/repos/kelloggm/checker-framework","labels_url":"https://api.github.com/repos/kelloggm/checker-framework/issues/58/labels{/name}","comments_url":"https://api.github.com/repos/kelloggm/checker-framework/issues/58/comments","events_url":"https://api.github.com/repos/kelloggm/checker-framework/issues/58/events","html_url":"https://github.com/kelloggm/checker-framework/issues/58","id":194798752,"number":58,"title":"Test against -1 should refine @GTENegativeOne to @NonNegative","user":{"login":"mernst","id":121025,"avatar_url":"https://avatars.githubusercontent.com/u/121025?v=3","gravatar_id":"","url":"https://api.github.com/users/mernst","html_url":"https://github.com/mernst","followers_url":"https://api.github.com/users/mernst/followers","following_url":"https://api.github.com/users/mernst/following{/other_user}","gists_url":"https://api.github.com/users/mernst/gists{/gist_id}","starred_url":"https://api.github.com/users/mernst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mernst/subscriptions","organizations_url":"https://api.github.com/users/mernst/orgs","repos_url":"https://api.github.com/users/mernst/repos","events_url":"https://api.github.com/users/mernst/events{/privacy}","received_events_url":"https://api.github.com/users/mernst/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-12-10T22:47:15Z","updated_at":"2016-12-10T22:47:15Z","closed_at":null,"body":"Here is a test case:\r\n\r\n```java\r\n  public static String replaceString(String target, String oldStr, String newStr) {\r\n    if (oldStr.equals(\"\")) {\r\n      throw new IllegalArgumentException();\r\n    }\r\n\r\n    StringBuffer result = new StringBuffer();\r\n    int lastend = 0;\r\n    int pos;\r\n    while ((pos = target.indexOf(oldStr, lastend)) != -1) {\r\n      result.append(target.substring(lastend, pos));\r\n      result.append(newStr);\r\n      lastend = pos + oldStr.length();\r\n    }\r\n    result.append(target.substring(lastend));\r\n    return result.toString();\r\n  }\r\n```\r\n\r\nThe checker can't tell that pos is `@NonNegative`.  The checker issues this warning:\r\n\r\n```\r\nwarning: [argument.type.incompatible] incompatible types in argument.\r\n      result.append(target.substring(lastend, pos));\r\n                                              ^\r\n  found   : @GTENegativeOne int\r\n  required: @NonNegative int\r\n```"}}
{"actor":{"display_login":"mernst"}}