projectlombok / lombok

Very spicy additions to the Java programming language.
https://projectlombok.org/
Other
12.86k stars 2.38k forks source link

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

Open wangxi761 opened 4 years ago

wangxi761 commented 4 years ago

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):

etki commented 4 years ago

Cannot find which symbol?
What java version is used?

janrieke commented 4 years ago

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