Apache Lucene open-source search software
harden checkJavaDocs.py: java7 writes extra newlines/divs before the class summary
Robert Muira762414610f4
diff --git a/dev-tools/scripts/checkJavaDocs.py b/dev-tools/scripts/checkJavaDocs.pyindex cf2ab6d0306..906599dfb43 100644--- a/dev-tools/scripts/checkJavaDocs.py+++ b/dev-tools/scripts/checkJavaDocs.py@@ -24,10 +24,10 @@ reMarkup = re.compile('<.*?>')def checkSummary(fullPath):printed = Falsef = open(fullPath)- lastLine = NoneanyMissing = FalsesawPackage = Falsedesc = []+ lastHREF = Nonefor line in f.readlines():lineLower = line.strip().lower()if desc is not None:@@ -51,22 +51,22 @@ def checkSummary(fullPath):desc.append(lineLower)if lineLower in ('<td> </td>', '<td></td>', '<td class="collast"> </td>'):- m = reHREF.search(lastLine)if not printed:print fullPathprinted = True- print ' missing: %s' % unescapeHTML(m.group(1))+ print ' missing: %s' % unescapeHTML(lastHREF)anyMissing = Trueelif lineLower.find('licensed to the apache software foundation') != -1 or lineLower.find('copyright 2004 the apache software foundation') != -1:- m = reHREF.search(lastLine)if not printed:print fullPathprinted = True- print ' license-is-javadoc: %s' % unescapeHTML(m.group(1))+ print ' license-is-javadoc: %s' % unescapeHTML(lastHREF)anyMissing = True- lastLine = line+ m = reHREF.search(line)+ if m is not None:+ lastHREF = m.group(1)if desc is not None and fullPath.find('/overview-summary.html') == -1:raise RuntimeError('BUG: failed to locate description in %s' % fullPath)f.close()