Class EnumEmptyConstructorFilter
- java.lang.Object
-
- org.jacoco.core.internal.analysis.filter.EnumEmptyConstructorFilter
-
- All Implemented Interfaces:
IFilter
public final class EnumEmptyConstructorFilter extends java.lang.Object implements IFilter
Filters empty enum constructors. Constructor of enum is invoked from static initialization block to create instance of each enum constant. So it won't be executed if number of enum constants is zero. Such enums are sometimes used as alternative to classes with static utilities and private empty constructor. Implicit constructor of enum created by compiler doesn't have a synthetic flag and refers to a line of enum definition. Therefore in order to not have partial coverage of enum definition line in enums without enum constants and similarly tofilter of private empty constructors
- empty constructor in enums without additional parameters should be filtered out even if it is not implicit.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
EnumEmptyConstructorFilter.Matcher
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
CONSTRUCTOR_DESC
private static java.lang.String
CONSTRUCTOR_NAME
private static java.lang.String
ENUM_TYPE
-
Constructor Summary
Constructors Constructor Description EnumEmptyConstructorFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
filter(org.objectweb.asm.tree.MethodNode methodNode, IFilterContext context, IFilterOutput output)
This method is called for every method.
-
-
-
Field Detail
-
CONSTRUCTOR_NAME
private static final java.lang.String CONSTRUCTOR_NAME
- See Also:
- Constant Field Values
-
CONSTRUCTOR_DESC
private static final java.lang.String CONSTRUCTOR_DESC
- See Also:
- Constant Field Values
-
ENUM_TYPE
private static final java.lang.String ENUM_TYPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
filter
public void filter(org.objectweb.asm.tree.MethodNode methodNode, IFilterContext context, IFilterOutput output)
Description copied from interface:IFilter
This method is called for every method. The filter implementation is expected to inspect the provided method and report its result to the givenIFilterOutput
instance.
-
-