Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] static import conflict,lombok annotation invalid #2403

Open
wangxi761 opened this issue Mar 19, 2020 · 2 comments
Open

[BUG] static import conflict,lombok annotation invalid #2403

wangxi761 opened this issue Mar 19, 2020 · 2 comments

Comments

@wangxi761
Copy link

Describe the bug
one class have @builder and a inner enum,
static import these,
then build the project ,it will appear "java:cannot find symbol"

To Reproduce

@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class EventCommand {
    private String id;
    private EventAssembler.EventAggregate agg;
    private Command type;

	public enum Command {
		addEvent,
		addNode,
		updateNode,
		updateEvent,
		updateEventAndNode
	}
}

another class

import static com.huya.eventcenter.entity.message.EventCommand.Command;
import static com.huya.eventcenter.entity.message.EventCommand.builder;

Expected behavior
Compile project normal

Version info (please complete the following information):

  • Lombok version:1.18.6
  • Platform windows idea
@etki
Copy link

etki commented Apr 9, 2020

Cannot find which symbol?
What java version is used?

@janrieke
Copy link
Contributor

janrieke commented Apr 9, 2020

Use a star (*) import instead. You cannot statically import lombok-generated types using a named, non-star import.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants