Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public final Description matchClass(ClassTree classTree, VisitorState state) {
return buildDescription(classTree)
.setMessage(
"This class is annotated with more than one scope annotation: "
+ annotationDebugString(scopeAnnotations)
+ annotationDebugString(scopeAnnotations, state)
+ ". However, classes can only have one scope annotation applied to them. "
+ "Please remove all but one of them.")
.build();
Expand All @@ -72,7 +72,8 @@ public final Description matchClass(ClassTree classTree, VisitorState state) {
return Description.NO_MATCH;
}

private static String annotationDebugString(List<AnnotationTree> scopeAnnotations) {
return Joiner.on(", ").join(scopeAnnotations);
private static String annotationDebugString(
List<AnnotationTree> scopeAnnotations, VisitorState state) {
return Joiner.on(", ").join(scopeAnnotations.stream().map(state::getSourceForNode).iterator());
}
}
Loading