You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2012/08/28 05:47:47 UTC

svn commit: r1377966 - /lucene/dev/trunk/dev-tools/scripts/checkJavaDocs.py

Author: rmuir
Date: Tue Aug 28 03:47:47 2012
New Revision: 1377966

URL: http://svn.apache.org/viewvc?rev=1377966&view=rev
Log:
prune overridden methods

Modified:
    lucene/dev/trunk/dev-tools/scripts/checkJavaDocs.py

Modified: lucene/dev/trunk/dev-tools/scripts/checkJavaDocs.py
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/dev-tools/scripts/checkJavaDocs.py?rev=1377966&r1=1377965&r2=1377966&view=diff
==============================================================================
--- lucene/dev/trunk/dev-tools/scripts/checkJavaDocs.py (original)
+++ lucene/dev/trunk/dev-tools/scripts/checkJavaDocs.py Tue Aug 28 03:47:47 2012
@@ -26,6 +26,11 @@ reTDLastNested = re.compile('<td class="
 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('&nbsp;', ' ')
@@ -44,8 +49,29 @@ def checkClass(fullPath):
   lastItem = None
 
   desc = None
+
+  foundMethodDetail = False
+  lastMethodAnchor = None
   
   for 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)