![]() |
![]() |
![]() |
This window shows a comparison between any two projects, packages, classes, or methods. It can compare two editions of the same program element, or any two different program elements of the same type. You cannot compare, for example, a class to a package.
You can then make changes to one of the program elements based on the contents of the other. For example, if you compare ClassA to ClassB, and ClassB has a method that ClassA does not, you can add that method to ClassA.
Differences Pane
The Differences pane summarizes the differences in the two program elements (or
editions). It lists each contained program element and indicates what the change is:
declaration changed; source code changed; contained element added; or contained
element removed.
Source Panes
The Left-Hand and Right-Hand Source panes show the source code for the two
compared program elements, and each contained program element. Each time an element
is selected in the Differences pane, the Source panes show the source code for the
element, and the first difference in the source is highlighted. Use the Next
Difference button
and the Previous Difference button
to move to the next or previous difference in the source
code.
Comparison Toolbar Buttons
The toolbar buttons that are unique to the Comparison Results window are the Ignore button and the Show Ignored Differences button.
![]() |
Click the Ignore button to ignore the selected difference. If ignored differences are shown, then if the selected difference is an ignored difference, clicking this button removes the ignored status from the difference. |
![]() |
When the Show Ignored Differences button is up, the Differences pane does not list ignored differences. |
![]() |
When the Show Ignored Differences button is down, the Differences pane lists the ignored differences, but puts their names in parentheses. |
Merging Differences
The following menu options help you merge differences from one of the compared
elements into the other:
Menu Option | What It Does |
Replace with Alternative (in Source pane pop-up menus) | Select an item in the Differences list. If the difference is changed source code or declaration, the corresponding code will be highlighted in each of the Source panes. Then select this option in the Right-Hand Source pane pop-up menu to replace the the highlighted code with the highlighted code in the Left-Hand Source pane. Alternatively, select this option in the Left-Hand Source pane pop-up menu to replace the highlighted code with the highlighted code in the Right-Hand Source pane. |
Load Left (in the Differences pane pop-up menu) | Replaces the contents of the program element in the Right-Hand Source pane with the contents in the Left-Hand Source pane. If there is no corresponding program element in the Left-Hand Source pane, then it deletes the program element in the Right-Hand Source pane. |
Load Right (in the Differences pane pop-up menu) | Replaces the contents of the program element in the Left-Hand Source pane with the contents in the Right-Hand Source pane. If there is no corresponding program element in the Right-Hand Source pane, then it deletes the program element in the Left-Hand source pane. |
These menu options are available only if the merge can be done.
Menus
The Comparison Results Window has the following menus:
Comparing Editions of a Program Element
Merging Editions of a Class or Interface