Skip to content

Commit

Permalink
Review round 1
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasz-tylenda-sonarsource committed Dec 20, 2024
1 parent 5cdf0db commit 02553e0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ public static boolean hasUnknownAnnotation(SymbolMetadata symbolMetadata) {
return symbolMetadata.annotations().stream().anyMatch(annotation -> annotation.symbol().isUnknown());
}

/// Returns the `name` part of a `fully.qualified.name`, that is, the part after the last dot.
/**
* Returns the `name` part of a `fully.qualified.name`, that is, the part after the last dot.
*/
public static String annotationTypeIdentifier(String fullyQualified) {
return fullyQualified.substring(fullyQualified.lastIndexOf('.') + 1);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public void visitNode(Tree tree) {
"Either add an explanation about why this test is skipped or remove the \"@%s\" annotation.",
shortName
);
JavaFileScannerContext.Location secondaryLocation =
var secondaryLocation =
new JavaFileScannerContext.Location(String.format("@%s annotation skips the test", shortName), annotationTree);
context.reportIssue(this, methodTree.simpleName(), message, Collections.singletonList(secondaryLocation), null);
});
Expand All @@ -91,7 +91,9 @@ public void visitNode(Tree tree) {
}
}

/// If a test method is silently ignored, returns the annotation that causes this behavior.
/**
* If a test method is silently ignored, returns the annotation that causes this behavior.
*/
private static Optional<AnnotationTree> getSilentlyIgnoredAnnotation(SymbolMetadata symbolMetadata, String fullyQualifiedName) {
// This code duplicates the behavior of SymbolMetadata.valuesForAnnotation but checks for broken semantics
for (SymbolMetadata.AnnotationInstance annotation : symbolMetadata.annotations()) {
Expand Down

0 comments on commit 02553e0

Please sign in to comment.