{"action":"created","issue":{"url":"https://api.github.com/repos/square/javapoet/issues/276","labels_url":"https://api.github.com/repos/square/javapoet/issues/276/labels{/name}","comments_url":"https://api.github.com/repos/square/javapoet/issues/276/comments","events_url":"https://api.github.com/repos/square/javapoet/issues/276/events","html_url":"https://github.com/square/javapoet/pull/276","id":75807035,"number":276,"title":"JavaFile.toJavaFileObject","user":{"login":"jgustie","id":883981,"avatar_url":"https://avatars.githubusercontent.com/u/883981?v=3","gravatar_id":"","url":"https://api.github.com/users/jgustie","html_url":"https://github.com/jgustie","followers_url":"https://api.github.com/users/jgustie/followers","following_url":"https://api.github.com/users/jgustie/following{/other_user}","gists_url":"https://api.github.com/users/jgustie/gists{/gist_id}","starred_url":"https://api.github.com/users/jgustie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgustie/subscriptions","organizations_url":"https://api.github.com/users/jgustie/orgs","repos_url":"https://api.github.com/users/jgustie/repos","events_url":"https://api.github.com/users/jgustie/events{/privacy}","received_events_url":"https://api.github.com/users/jgustie/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-13T01:42:37Z","updated_at":"2015-05-13T03:15:19Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/square/javapoet/pulls/276","html_url":"https://github.com/square/javapoet/pull/276","diff_url":"https://github.com/square/javapoet/pull/276.diff","patch_url":"https://github.com/square/javapoet/pull/276.patch"},"body":"As discussed in #267, adds a helper to simplify passing a `JavaFile` to a `javax.tools.JavaCompiler`."},"comment":{"url":"https://api.github.com/repos/square/javapoet/issues/comments/101493651","html_url":"https://github.com/square/javapoet/pull/276#issuecomment-101493651","issue_url":"https://api.github.com/repos/square/javapoet/issues/276","id":101493651,"user":{"login":"jgustie","id":883981,"avatar_url":"https://avatars.githubusercontent.com/u/883981?v=3","gravatar_id":"","url":"https://api.github.com/users/jgustie","html_url":"https://github.com/jgustie","followers_url":"https://api.github.com/users/jgustie/followers","following_url":"https://api.github.com/users/jgustie/following{/other_user}","gists_url":"https://api.github.com/users/jgustie/gists{/gist_id}","starred_url":"https://api.github.com/users/jgustie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgustie/subscriptions","organizations_url":"https://api.github.com/users/jgustie/orgs","repos_url":"https://api.github.com/users/jgustie/repos","events_url":"https://api.github.com/users/jgustie/events{/privacy}","received_events_url":"https://api.github.com/users/jgustie/received_events","type":"User","site_admin":false},"created_at":"2015-05-13T03:15:19Z","updated_at":"2015-05-13T03:15:19Z","body":"Squashed some nits, let me know if there is anything else.\r\n\r\nThe `compileJavaTest` is largely what I wanted to accomplish: getting a `JavaFile` right into the compiler. I agree that there are other ways you can take this though: you could imagine a `JavaFileManager` implementation similar to the [Compile Testing](https://github.com/google/compile-testing) `InMemoryJavaFileManager` that by-passes the need to go to disk and compiles JavaPoet output directly into a live class loader; or you could have a no-op file manager and just capture the output from the diagnostic collector and provide real-time compilation errors for a `JavaFile` (take it a step further and use something like [Error Prone](http://errorprone.info/) for additional analysis); you could also rig something like `JavaFile.process(Processor)` to run other annotation processors over generated code by passing the processors into the `CompilationTask` (might be useful for [AutoService](https://github.com/google/auto/tree/master/service)).\r\n\r\nSeed planted ;)"}}