net.sourceforge.cobertura.instrument
Class Main
java.lang.Object
net.sourceforge.cobertura.instrument.Main
Add coverage instrumentation to existing classes.
What does that mean, exactly?
It means Cobertura will look at each class you give it. It
loads the bytecode into memory. For each line of source,
Cobertura adds a few extra instructions. These instructions
do the following:
- Get an instance of the ProjectData class.
- Call a method in this ProjectData class that increments
a counter for this line of code.
After every line in a class has been "instrumented," Cobertura
edits the bytecode for the class one more time and adds
"implements net.sourceforge.cobertura.coveragedata.HasBeenInstrumented"
This is basically just a flag used internally by Cobertura to
determine whether a class has been instrumented or not, so
as not to instrument the same class twice.
logger
private static final Logger logger
addInstrumentationToArchive
private boolean addInstrumentationToArchive(CoberturaFile file,
InputStream archive,
OutputStream output)
throws Exception
addInstrumentationToArchive
private boolean addInstrumentationToArchive(CoberturaFile file,
ZipInputStream archive,
ZipOutputStream output)
throws Exception
isClass
private static boolean isClass(ZipEntry entry)
- True if the specified entry has "class" as its extension,
false otherwise.
main
public static void main(String[] args)