{"action":"created","issue":{"url":"https://api.github.com/repos/rzwitserloot/lombok/issues/979","repository_url":"https://api.github.com/repos/rzwitserloot/lombok","labels_url":"https://api.github.com/repos/rzwitserloot/lombok/issues/979/labels{/name}","comments_url":"https://api.github.com/repos/rzwitserloot/lombok/issues/979/comments","events_url":"https://api.github.com/repos/rzwitserloot/lombok/issues/979/events","html_url":"https://github.com/rzwitserloot/lombok/issues/979","id":119036111,"number":979,"title":"Static import of builder class breaks bytecode generation in Maven","user":{"login":"jelmo","id":1053853,"avatar_url":"https://avatars0.githubusercontent.com/u/1053853?v=3","gravatar_id":"","url":"https://api.github.com/users/jelmo","html_url":"https://github.com/jelmo","followers_url":"https://api.github.com/users/jelmo/followers","following_url":"https://api.github.com/users/jelmo/following{/other_user}","gists_url":"https://api.github.com/users/jelmo/gists{/gist_id}","starred_url":"https://api.github.com/users/jelmo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jelmo/subscriptions","organizations_url":"https://api.github.com/users/jelmo/orgs","repos_url":"https://api.github.com/users/jelmo/repos","events_url":"https://api.github.com/users/jelmo/events{/privacy}","received_events_url":"https://api.github.com/users/jelmo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2015-11-26T12:31:08Z","updated_at":"2017-03-01T00:04:09Z","closed_at":null,"body":"I have a class Foo annotated with @Builder. \n\n```\n@Builder\npublic class Foo {\n    ...\n}\n```\n\nI use the generated class Foo.FooBuilder in Bar, but I statically import Foo.Builder so that I can refer directly to FooBuilder in the code:\n\n```\nimport static my.org.Foo.FooBuilder\npublic class Bar {\n  public void bar() {\n    FooBuilder builder = Foo.builder();\n    ...\n  }\n}\n```\n\nIn IntelliJ with the Lombok plugin, this compiles and works fine.\nHowever, when building with Maven, this breaks completely the whole bytecode generation phase. All Lombok generated classes and methods, even from other unrelated Lombok annotations, are rejected by javac with 'cannot find symbol' errors. \nIf I remove the static import and change the code to `Foo.FooBuilder builder = Foo.builder()` everything works as expected...\n\nUsing Lombok 1.16.6 with Java 8.\n"},"comment":{"url":"https://api.github.com/repos/rzwitserloot/lombok/issues/comments/283201532","html_url":"https://github.com/rzwitserloot/lombok/issues/979#issuecomment-283201532","issue_url":"https://api.github.com/repos/rzwitserloot/lombok/issues/979","id":283201532,"user":{"login":"omega09","id":20368441,"avatar_url":"https://avatars1.githubusercontent.com/u/20368441?v=3","gravatar_id":"","url":"https://api.github.com/users/omega09","html_url":"https://github.com/omega09","followers_url":"https://api.github.com/users/omega09/followers","following_url":"https://api.github.com/users/omega09/following{/other_user}","gists_url":"https://api.github.com/users/omega09/gists{/gist_id}","starred_url":"https://api.github.com/users/omega09/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omega09/subscriptions","organizations_url":"https://api.github.com/users/omega09/orgs","repos_url":"https://api.github.com/users/omega09/repos","events_url":"https://api.github.com/users/omega09/events{/privacy}","received_events_url":"https://api.github.com/users/omega09/received_events","type":"User","site_admin":false},"created_at":"2017-03-01T00:04:09Z","updated_at":"2017-03-01T00:04:09Z","body":"Using Gradle, define the following classes:\r\n\r\n```\r\npackage p1;\r\n\r\nimport static p2.StaticContainer.getSomeInt;\r\n\r\npublic class Tester {}\r\n```\r\n\r\nand\r\n\r\n```\r\npackage p2;\r\n\r\nimport lombok.Getter;\r\n\r\npublic class StaticContainer {\r\n\r\n\t@Getter private static int someInt;\r\n\r\n//\tpublic static int getSomeInt() { return someInt; }\r\n}\r\n```\r\n\r\nRun the `build` command. You will get the following error:\r\n\r\n> Execution failed for task ':compileJava'.\r\n> \\> Compilation failed; see the compiler error output for details.\r\n\r\n> error: cannot find symbol\r\n> import static p2.StaticContainer.getSomeInt;\r\n> ^\r\n>   symbol:   static getSomeInt\r\n>   location: class\r\n\r\nNote that replacing the import declaration with the wildcard:\r\n\r\n    import static p2.StaticContainer.*;\r\n\r\nfixes the problem, as well as explicitly writing the method."}}
{"actor":{"display_login":"omega09"}}