如果我在值为PRIVATE
的字段上使用Lombok @Setting注释@Data
@AllArgsConstructor
@NoArgsConstructor
public class Notification implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Setter(value = AccessLevel.PRIVATE)
private String id;
private long userId;
private Event event;
private long timestamp = System.currentTimeMillis();
public Notification(final String id) {
this.id = id;
}
}
Sonar Maven插件出现以下错误:
ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.7.1:sonar (default-cli) on project mio-events: Unable to analyze .class file tv/nativ/mio/event/model/Notification: 0 is not a valid line for a file -> [Help 1]
将@Setting值更改为public可解决此问题,同样删除@Setting并为该字段添加手动私有设置器。
知道问题可能是什么?
由于
尼克
答案 0 :(得分:0)
声纳并不真正支持龙目岛:Feature request for lombok like tools
在运行声纳之前,您应该对源进行delombok并使用生成的源进行分析。有关这方面的信息在页面上:Delombok。如果你正在使用maven,那么在这里使用这种技术的一个例子是:Example Pom