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
isArchive
private static boolean isArchive(File file)
- True if file has an extension that matches one of the
standard java archives, false otherwise.
isClass
private static boolean isClass(File file)
file
- A file.
- True if the specified file has "class" as its extension,
false otherwise.
isClass
private static boolean isClass(ZipEntry entry)
entry
- A zip entry.
- True if the specified entry has "class" as its extension,
false otherwise.
main
public static void main(String[] args)