The Annotated Source view, source code with annotations display

In the Annotated Source view, the display of annotations for source code 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 click 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 source data in the Annotated Source view.

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 check mark, click the command to remove the check mark. 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

These are the default annotations that are used in the display:
  • Lines that have been tested are displayed in green with a Icon for a covered element in the left margin.
  • Lines that have not been tested are displayed in red with a Icon for a missed element in the left margin.
  • Lines that have been partially tested are displayed in orange with a Icon for a partially covered element in the left margin. A line is partially tested if it contains multiple units (executable byte code commands) and not all units were exercised.
Note: Breakpoints that were inserted while using the Java editor are also displayed in the left margin. In the Annotated Source view, you can disable and re-enable these breakpoints.

Controls

The following toolbar buttons and menu commands are available in the Annotated Source view:
Toolbar button Command Description
Annotated Source toggle button

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 button

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.

Context menu

Disable Breakpoint, Enable Breakpoint

Toggles breakpoints off and on

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.
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
Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.