Class GeneratedAnnotationScanner
java.lang.Object
com.arc_e_tect.gradle.jacoco.scan.GeneratedAnnotationScanner
Scans a compiled
.class file for members that JaCoCo automatically
excludes from coverage because they carry an annotation whose simple name
is Generated — the same convention JaCoCo itself relies on since
version 0.8.2.
This covers code synthesised by another tool that stamps its output with
such an annotation, most notably Lombok's @lombok.Generated on
every getter, setter, constructor, equals/hashCode/
toString, and builder method it generates. These members never exist in
the .java source, so — unlike AnnotationScanner — this
scanner reads bytecode rather than parsing source.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionScans one.classfile and returns every member carrying aGenerated-named annotation.
-
Constructor Details
-
GeneratedAnnotationScanner
public GeneratedAnnotationScanner()
-
-
Method Details
-
scan
Scans one.classfile and returns every member carrying aGenerated-named annotation.- Parameters:
classFile- the compiled class file to inspect- Returns:
- possibly-empty list of excluded elements, never
null - Throws:
IOException- if the file cannot be read or is not a valid class file
-