This page documents the process(es) that implement a mechanism to validate that the RI and stubs are in agreement. It turns out that this is trickier than one might guess.

The RI and stubs need to agree in two areas:

Comparing these two facets directly is somewhat problematic since the two code bases are formatted differently. Fortunately there is a tool (Javadoc) that is customizable for this situation. The Javadoc framework does the heavy lifting (parsing the code) and then calls a custom "doclet" - in this case APIRipper 
(https://community.cablelabs.com/svn/OCAPRI/trunk/common/tools/stublet/com/cablelabs/tools/stublet/APIRipper.java). This doclet constructs normalized files of the designated code base. Javadoc is invoked on the two code bases (the RI and the stubs) and the output saved on disk. These files are then "diff'd", resulting in output that indicates differences between the two code bases. The objective is to have no differences...

Of course that is "easier said than done". In addition we need a mechanism in order to ignore:

For trivial differences APIRipper has a mechanism using properties files for excluding various things (see the code for documentation).
This same mechanism is used for ignoring non-trivial differences that will likely be resolved by changing code in the RI. Each ignored component is identified in the file with a comment that points back to the particular OCORI issue. As the OCORI issues are resolved the ignored component should be included in the analysis.
For differences that may result in changing the stubs (and likely specifications), patches are checked into https://community.cablelabs.com/svn/OCAPRI/trunk/common/tools/stublet/known_diffs/. Theses patches are applied before analysis (and then reversed). Each patch identifies the particular OCSPEC or OCVET issue. As the OCSPEC/OCVET issue is resolved, the patch should be removed from the analysis.

There are ant targets that encapsulate the complexities:
In build.xml,

The workflow that I figured out when working on stub patches is

This way the patches are isolated - sometimes this doesn't work and you have to figure out a "late patch", but generally the described workflow works.