Apache Lucene open-source search software
prune overridden methods
Robert Muir182d59b75e16
diff --git a/dev-tools/scripts/checkJavaDocs.py b/dev-tools/scripts/checkJavaDocs.pyindex 8152251519f..e4484dd8d84 100644--- a/dev-tools/scripts/checkJavaDocs.py+++ b/dev-tools/scripts/checkJavaDocs.py@@ -26,6 +26,11 @@ reTDLastNested = re.compile('<td class="colLast"><code><strong><a href="[^>]*\.(reTDLast = re.compile('<td class="colLast"><code><strong><a href="[^>]*#([^>]*?)">', re.IGNORECASE)reColOne = re.compile('<td class="colOne"><code><strong><a href="[^>]*#([^>]*?)">', re.IGNORECASE)+# the Method detail section at the end+reMethodDetail = re.compile('^<h3>Method Detail</h3>$', re.IGNORECASE)+reMethodDetailAnchor = re.compile('^<a name="([^>]*?)">$', re.IGNORECASE)+reMethodOverridden = re.compile('^<dt><strong>(Specified by:|Overrides:)</strong></dt>$', re.IGNORECASE)+def cleanHTML(s):s = reMarkup.sub('', s)s = s.replace(' ', ' ')@@ -44,8 +49,29 @@ def checkClass(fullPath):lastItem = Nonedesc = None++ foundMethodDetail = False+ lastMethodAnchor = Nonefor line in f.readlines():+ m = reMethodDetail.search(line)+ if m is not None:+ foundMethodDetail = True+ continue++ # prune methods that are just @Overrides of other interface/classes,+ # they should be specified elsewhere, if they are e.g. jdk or+ # external classes we cannot inherit their docs anyway+ if foundMethodDetail:+ m = reMethodDetailAnchor.search(line)+ if m is not None:+ lastMethodAnchor = m.group(1)+ continue+ m = reMethodOverridden.search(line)+ if m is not None and ('Methods', lastMethodAnchor) in missing:+ #print('removing @overridden method: %s' % lastMethodAnchor)+ missing.remove(('Methods', lastMethodAnchor))+m = reCaption.search(line)if m is not None:lastCaption = m.group(1)