The Annotated Source view, source code with annotations display
The coverage source code display of the Annotated Source view includes a copy of the source code marked with line-level coverage annotations.
To display the Annotated Source view, right-click a profiling resource entry in the Profiling Monitor, then select Open With > Coverage Details. Data for the resource must have been collected with a profiling set that included the Method and Line Code Coverage profiling type. Click a class or method in the Coverage Navigator view to display the annotated source code for the class or method.
Clicking an entry in the Coverage Navigator at the package level or above displays the Annotated Source view’s source data display.
Note: If you have collected coverage data for multiple profiling runs, the results are merged automatically at the host level and above with data collected. To display the Host profiling resource, open the Profiling Monitor drop-down menu and, if the Hide Host command is preceded by a checkmark, click the command to remove the checkmark. You can now open the coverage views for the host-level profiling resource.
Navigation
The right margin shows a map of the location of tested (green), untested (red), and partially tested (orange) code. Use this map to scroll to the sections of code that interest you.
Annotations
A copy of the source is displayed, annotated by default as follows:
- Lines that have been tested are displayed in green with a
in the left margin.
- Lines that have not been tested are displayed in red with a
in the left margin.
- Lines that have been partially tested are displayed in orange with a
in the left margin. A line is partially tested if it contains multiple units (executable byte code commands) and not all units were exercised.
Controls
The following toolbar buttons and menu commands appear in the Annotated Source view:
Toolbar Button Command Description Show Source Code with Annotations, or Show Source Data
Toggles the Annotated Source view to show either the source code with annotations or the source data.
Open Source for Editing
Displays the source code, if available, for the selected item. Source code is available only if you are profiling a Java project that is currently open in the Java perspective.
Note: If this view reports No data available for display after you have collected line and method coverage data, flush the data manually for subsequent runs.
Parent topic
Code coverage monitoring user interface reference
Related tasks
Collecting coverage data for lines and methods
Viewing and analyzing coverage data for lines and methods
Related reference
The Annotated Source view, source data display