{"action":"created","comment":{"url":"https://api.github.com/repos/square/wire/pulls/comments/72798533","id":72798533,"diff_hunk":"@@ -21,51 +21,69 @@\n import com.google.common.io.Closer;\n import com.squareup.wire.java.internal.ProfileFileElement;\n import com.squareup.wire.java.internal.ProfileParser;\n+import com.squareup.wire.java.internal.TypeConfigElement;\n import com.squareup.wire.schema.Location;\n import com.squareup.wire.schema.ProtoFile;\n+import com.squareup.wire.schema.ProtoType;\n import com.squareup.wire.schema.Schema;\n+import com.squareup.wire.schema.SchemaException;\n+import com.squareup.wire.schema.Type;\n import java.io.IOException;\n import java.nio.file.FileSystem;\n import java.nio.file.FileSystems;\n import java.nio.file.Files;\n import java.nio.file.Path;\n-import java.nio.file.Paths;\n+import java.util.ArrayList;\n import java.util.Collection;\n import java.util.LinkedHashSet;\n+import java.util.List;\n import java.util.Map;\n import java.util.Set;\n import okio.Okio;\n import okio.Source;\n \n+import static com.google.common.base.Preconditions.checkState;\n import static com.google.common.collect.Iterables.getOnlyElement;\n \n /**\n  * Load files with the {@code .wire} suffix for a schema. The file name is the profile name; for\n  * example the {@code android} profile loads {@code android.wire} files.\n  */\n public final class ProfileLoader {\n+  private final FileSystem fileSystem;\n   private final String name;\n-  private final Set<Location> protoLocations = new LinkedHashSet<>();\n+  private Schema schema;\n \n-  public ProfileLoader(String name) {\n+  public ProfileLoader(FileSystem fileSystem, String name) {\n+    this.fileSystem = fileSystem;\n     this.name = name;\n   }\n \n-  public ProfileLoader addSchema(Schema schema) {\n-    for (ProtoFile protoFile : schema.protoFiles()) {\n-      protoLocations.add(protoFile.location());\n-    }\n-    return this;\n+  public ProfileLoader(String name) {\n+    this(FileSystems.getDefault(), name);\n   }\n \n-  public ProfileLoader addProtoLocation(Location location) {\n-    protoLocations.add(location);\n+  public ProfileLoader schema(Schema schema) {\n+    checkState(this.schema == null);","path":"wire-java-generator/src/main/java/com/squareup/wire/java/ProfileLoader.java","position":57,"original_position":57,"commit_id":"cd2c16806c94d258a67826d1436c18e5c5cdcfa7","original_commit_id":"cd2c16806c94d258a67826d1436c18e5c5cdcfa7","user":{"login":"swankjesse","id":133019,"avatar_url":"https://avatars.githubusercontent.com/u/133019?v=3","gravatar_id":"","url":"https://api.github.com/users/swankjesse","html_url":"https://github.com/swankjesse","followers_url":"https://api.github.com/users/swankjesse/followers","following_url":"https://api.github.com/users/swankjesse/following{/other_user}","gists_url":"https://api.github.com/users/swankjesse/gists{/gist_id}","starred_url":"https://api.github.com/users/swankjesse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swankjesse/subscriptions","organizations_url":"https://api.github.com/users/swankjesse/orgs","repos_url":"https://api.github.com/users/swankjesse/repos","events_url":"https://api.github.com/users/swankjesse/events{/privacy}","received_events_url":"https://api.github.com/users/swankjesse/received_events","type":"User","site_admin":false},"body":"this is an ISE for calling `schema()` 2x","created_at":"2016-07-29T14:18:09Z","updated_at":"2016-07-29T14:18:09Z","html_url":"https://github.com/square/wire/pull/620#discussion_r72798533","pull_request_url":"https://api.github.com/repos/square/wire/pulls/620","_links":{"self":{"href":"https://api.github.com/repos/square/wire/pulls/comments/72798533"},"html":{"href":"https://github.com/square/wire/pull/620#discussion_r72798533"},"pull_request":{"href":"https://api.github.com/repos/square/wire/pulls/620"}}},"pull_request":{"url":"https://api.github.com/repos/square/wire/pulls/620","id":79260358,"html_url":"https://github.com/square/wire/pull/620","diff_url":"https://github.com/square/wire/pull/620.diff","patch_url":"https://github.com/square/wire/pull/620.patch","issue_url":"https://api.github.com/repos/square/wire/issues/620","number":620,"state":"closed","locked":false,"title":"Validate that profiles are well-formed.","user":{"login":"swankjesse","id":133019,"avatar_url":"https://avatars.githubusercontent.com/u/133019?v=3","gravatar_id":"","url":"https://api.github.com/users/swankjesse","html_url":"https://github.com/swankjesse","followers_url":"https://api.github.com/users/swankjesse/followers","following_url":"https://api.github.com/users/swankjesse/following{/other_user}","gists_url":"https://api.github.com/users/swankjesse/gists{/gist_id}","starred_url":"https://api.github.com/users/swankjesse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swankjesse/subscriptions","organizations_url":"https://api.github.com/users/swankjesse/orgs","repos_url":"https://api.github.com/users/swankjesse/repos","events_url":"https://api.github.com/users/swankjesse/events{/privacy}","received_events_url":"https://api.github.com/users/swankjesse/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-07-28T20:13:23Z","updated_at":"2016-07-29T14:18:09Z","closed_at":"2016-07-28T21:11:32Z","merged_at":"2016-07-28T21:11:32Z","merge_commit_sha":"b2ec55c7eb09ca441121f3c0b54a5dd4714ea2a9","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/square/wire/pulls/620/commits","review_comments_url":"https://api.github.com/repos/square/wire/pulls/620/comments","review_comment_url":"https://api.github.com/repos/square/wire/pulls/comments{/number}","comments_url":"https://api.github.com/repos/square/wire/issues/620/comments","statuses_url":"https://api.github.com/repos/square/wire/statuses/cd2c16806c94d258a67826d1436c18e5c5cdcfa7","head":{"label":"square:jwilson.0728.validate_profile","ref":"jwilson.0728.validate_profile","sha":"cd2c16806c94d258a67826d1436c18e5c5cdcfa7","user":{"login":"square","id":82592,"avatar_url":"https://avatars.githubusercontent.com/u/82592?v=3","gravatar_id":"","url":"https://api.github.com/users/square","html_url":"https://github.com/square","followers_url":"https://api.github.com/users/square/followers","following_url":"https://api.github.com/users/square/following{/other_user}","gists_url":"https://api.github.com/users/square/gists{/gist_id}","starred_url":"https://api.github.com/users/square/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/square/subscriptions","organizations_url":"https://api.github.com/users/square/orgs","repos_url":"https://api.github.com/users/square/repos","events_url":"https://api.github.com/users/square/events{/privacy}","received_events_url":"https://api.github.com/users/square/received_events","type":"Organization","site_admin":false},"repo":{"id":12274147,"name":"wire","full_name":"square/wire","owner":{"login":"square","id":82592,"avatar_url":"https://avatars.githubusercontent.com/u/82592?v=3","gravatar_id":"","url":"https://api.github.com/users/square","html_url":"https://github.com/square","followers_url":"https://api.github.com/users/square/followers","following_url":"https://api.github.com/users/square/following{/other_user}","gists_url":"https://api.github.com/users/square/gists{/gist_id}","starred_url":"https://api.github.com/users/square/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/square/subscriptions","organizations_url":"https://api.github.com/users/square/orgs","repos_url":"https://api.github.com/users/square/repos","events_url":"https://api.github.com/users/square/events{/privacy}","received_events_url":"https://api.github.com/users/square/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/square/wire","description":"Clean, lightweight protocol buffers for Android and Java.","fork":false,"url":"https://api.github.com/repos/square/wire","forks_url":"https://api.github.com/repos/square/wire/forks","keys_url":"https://api.github.com/repos/square/wire/keys{/key_id}","collaborators_url":"https://api.github.com/repos/square/wire/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/square/wire/teams","hooks_url":"https://api.github.com/repos/square/wire/hooks","issue_events_url":"https://api.github.com/repos/square/wire/issues/events{/number}","events_url":"https://api.github.com/repos/square/wire/events","assignees_url":"https://api.github.com/repos/square/wire/assignees{/user}","branches_url":"https://api.github.com/repos/square/wire/branches{/branch}","tags_url":"https://api.github.com/repos/square/wire/tags","blobs_url":"https://api.github.com/repos/square/wire/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/square/wire/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/square/wire/git/refs{/sha}","trees_url":"https://api.github.com/repos/square/wire/git/trees{/sha}","statuses_url":"https://api.github.com/repos/square/wire/statuses/{sha}","languages_url":"https://api.github.com/repos/square/wire/languages","stargazers_url":"https://api.github.com/repos/square/wire/stargazers","contributors_url":"https://api.github.com/repos/square/wire/contributors","subscribers_url":"https://api.github.com/repos/square/wire/subscribers","subscription_url":"https://api.github.com/repos/square/wire/subscription","commits_url":"https://api.github.com/repos/square/wire/commits{/sha}","git_commits_url":"https://api.github.com/repos/square/wire/git/commits{/sha}","comments_url":"https://api.github.com/repos/square/wire/comments{/number}","issue_comment_url":"https://api.github.com/repos/square/wire/issues/comments{/number}","contents_url":"https://api.github.com/repos/square/wire/contents/{+path}","compare_url":"https://api.github.com/repos/square/wire/compare/{base}...{head}","merges_url":"https://api.github.com/repos/square/wire/merges","archive_url":"https://api.github.com/repos/square/wire/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/square/wire/downloads","issues_url":"https://api.github.com/repos/square/wire/issues{/number}","pulls_url":"https://api.github.com/repos/square/wire/pulls{/number}","milestones_url":"https://api.github.com/repos/square/wire/milestones{/number}","notifications_url":"https://api.github.com/repos/square/wire/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/square/wire/labels{/name}","releases_url":"https://api.github.com/repos/square/wire/releases{/id}","deployments_url":"https://api.github.com/repos/square/wire/deployments","created_at":"2013-08-21T15:45:47Z","updated_at":"2016-07-29T07:01:07Z","pushed_at":"2016-07-28T21:53:39Z","git_url":"git://github.com/square/wire.git","ssh_url":"git@github.com:square/wire.git","clone_url":"https://github.com/square/wire.git","svn_url":"https://github.com/square/wire","homepage":"","size":6739,"stargazers_count":1611,"watchers_count":1611,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":242,"mirror_url":null,"open_issues_count":29,"forks":242,"open_issues":29,"watchers":1611,"default_branch":"master"}},"base":{"label":"square:master","ref":"master","sha":"1b3c1dbb738db19333621dc635172ea27b8c438e","user":{"login":"square","id":82592,"avatar_url":"https://avatars.githubusercontent.com/u/82592?v=3","gravatar_id":"","url":"https://api.github.com/users/square","html_url":"https://github.com/square","followers_url":"https://api.github.com/users/square/followers","following_url":"https://api.github.com/users/square/following{/other_user}","gists_url":"https://api.github.com/users/square/gists{/gist_id}","starred_url":"https://api.github.com/users/square/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/square/subscriptions","organizations_url":"https://api.github.com/users/square/orgs","repos_url":"https://api.github.com/users/square/repos","events_url":"https://api.github.com/users/square/events{/privacy}","received_events_url":"https://api.github.com/users/square/received_events","type":"Organization","site_admin":false},"repo":{"id":12274147,"name":"wire","full_name":"square/wire","owner":{"login":"square","id":82592,"avatar_url":"https://avatars.githubusercontent.com/u/82592?v=3","gravatar_id":"","url":"https://api.github.com/users/square","html_url":"https://github.com/square","followers_url":"https://api.github.com/users/square/followers","following_url":"https://api.github.com/users/square/following{/other_user}","gists_url":"https://api.github.com/users/square/gists{/gist_id}","starred_url":"https://api.github.com/users/square/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/square/subscriptions","organizations_url":"https://api.github.com/users/square/orgs","repos_url":"https://api.github.com/users/square/repos","events_url":"https://api.github.com/users/square/events{/privacy}","received_events_url":"https://api.github.com/users/square/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/square/wire","description":"Clean, lightweight protocol buffers for Android and Java.","fork":false,"url":"https://api.github.com/repos/square/wire","forks_url":"https://api.github.com/repos/square/wire/forks","keys_url":"https://api.github.com/repos/square/wire/keys{/key_id}","collaborators_url":"https://api.github.com/repos/square/wire/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/square/wire/teams","hooks_url":"https://api.github.com/repos/square/wire/hooks","issue_events_url":"https://api.github.com/repos/square/wire/issues/events{/number}","events_url":"https://api.github.com/repos/square/wire/events","assignees_url":"https://api.github.com/repos/square/wire/assignees{/user}","branches_url":"https://api.github.com/repos/square/wire/branches{/branch}","tags_url":"https://api.github.com/repos/square/wire/tags","blobs_url":"https://api.github.com/repos/square/wire/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/square/wire/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/square/wire/git/refs{/sha}","trees_url":"https://api.github.com/repos/square/wire/git/trees{/sha}","statuses_url":"https://api.github.com/repos/square/wire/statuses/{sha}","languages_url":"https://api.github.com/repos/square/wire/languages","stargazers_url":"https://api.github.com/repos/square/wire/stargazers","contributors_url":"https://api.github.com/repos/square/wire/contributors","subscribers_url":"https://api.github.com/repos/square/wire/subscribers","subscription_url":"https://api.github.com/repos/square/wire/subscription","commits_url":"https://api.github.com/repos/square/wire/commits{/sha}","git_commits_url":"https://api.github.com/repos/square/wire/git/commits{/sha}","comments_url":"https://api.github.com/repos/square/wire/comments{/number}","issue_comment_url":"https://api.github.com/repos/square/wire/issues/comments{/number}","contents_url":"https://api.github.com/repos/square/wire/contents/{+path}","compare_url":"https://api.github.com/repos/square/wire/compare/{base}...{head}","merges_url":"https://api.github.com/repos/square/wire/merges","archive_url":"https://api.github.com/repos/square/wire/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/square/wire/downloads","issues_url":"https://api.github.com/repos/square/wire/issues{/number}","pulls_url":"https://api.github.com/repos/square/wire/pulls{/number}","milestones_url":"https://api.github.com/repos/square/wire/milestones{/number}","notifications_url":"https://api.github.com/repos/square/wire/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/square/wire/labels{/name}","releases_url":"https://api.github.com/repos/square/wire/releases{/id}","deployments_url":"https://api.github.com/repos/square/wire/deployments","created_at":"2013-08-21T15:45:47Z","updated_at":"2016-07-29T07:01:07Z","pushed_at":"2016-07-28T21:53:39Z","git_url":"git://github.com/square/wire.git","ssh_url":"git@github.com:square/wire.git","clone_url":"https://github.com/square/wire.git","svn_url":"https://github.com/square/wire","homepage":"","size":6739,"stargazers_count":1611,"watchers_count":1611,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":242,"mirror_url":null,"open_issues_count":29,"forks":242,"open_issues":29,"watchers":1611,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/square/wire/pulls/620"},"html":{"href":"https://github.com/square/wire/pull/620"},"issue":{"href":"https://api.github.com/repos/square/wire/issues/620"},"comments":{"href":"https://api.github.com/repos/square/wire/issues/620/comments"},"review_comments":{"href":"https://api.github.com/repos/square/wire/pulls/620/comments"},"review_comment":{"href":"https://api.github.com/repos/square/wire/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/square/wire/pulls/620/commits"},"statuses":{"href":"https://api.github.com/repos/square/wire/statuses/cd2c16806c94d258a67826d1436c18e5c5cdcfa7"}}}}
{"actor":{"display_login":"swankjesse"}}