Apache Lucene open-source search software
improve broken link checker; fix some broken links
Michael McCandless79894b9744ba
diff --git a/dev-tools/scripts/checkJavadocLinks.py b/dev-tools/scripts/checkJavadocLinks.pyindex 8b5df30d8a2..2d8ca1c8cf8 100644--- a/dev-tools/scripts/checkJavadocLinks.py+++ b/dev-tools/scripts/checkJavadocLinks.py@@ -1,3 +1,18 @@+# Licensed to the Apache Software Foundation (ASF) under one or more+# contributor license agreements. See the NOTICE file distributed with+# this work for additional information regarding copyright ownership.+# The ASF licenses this file to You under the Apache License, Version 2.0+# (the "License"); you may not use this file except in compliance with+# the License. You may obtain a copy of the License at+#+# http://www.apache.org/licenses/LICENSE-2.0+#+# Unless required by applicable law or agreed to in writing, software+# distributed under the License is distributed on an "AS IS" BASIS,+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+# See the License for the specific language governing permissions and+# limitations under the License.+import tracebackimport osimport sys@@ -62,6 +77,7 @@ class FindHyperlinks(HTMLParser):self.printed = Truedef parse(baseURL, html):+ global failuresparser = FindHyperlinks(baseURL)try:parser.feed(html)@@ -70,17 +86,22 @@ def parse(baseURL, html):parser.printFile()print ' WARNING: failed to parse:'traceback.print_exc()+ failures = Truereturn [], []#print ' %d links, %d anchors' % \# (len(parser.links), len(parser.anchors))return parser.links, parser.anchors+failures = False+def checkAll(dirName):"""Checks *.html (recursively) under this directory."""+ global failures+# Find/parse all HTML files firstprint 'Crawl/parse...'@@ -150,6 +171,13 @@ def checkAll(dirName):print fullPathprint ' BROKEN ANCHOR: %s' % origLink++ failures = failures or printed++ if failures:+ sys.exit(1)+ else:+ sys.exit(0)if __name__ == '__main__':checkAll(sys.argv[1])diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/commongrams/CommonGramsFilter.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/commongrams/CommonGramsFilter.javaindex 9798464f938..2b56245d209 100644--- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/commongrams/CommonGramsFilter.java+++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/commongrams/CommonGramsFilter.java@@ -44,7 +44,7 @@ import org.apache.lucene.util.Version;*/public final class CommonGramsFilter extends TokenFilter {- static final String GRAM_TYPE = "gram";+ public static final String GRAM_TYPE = "gram";private static final char SEPARATOR = '_';private final CharArraySet commonWords;diff --git a/lucene/benchmark/src/java/org/apache/lucene/benchmark/quality/package.html b/lucene/benchmark/src/java/org/apache/lucene/benchmark/quality/package.htmlindex be2622c2943..c37dd1e9978 100755--- a/lucene/benchmark/src/java/org/apache/lucene/benchmark/quality/package.html+++ b/lucene/benchmark/src/java/org/apache/lucene/benchmark/quality/package.html@@ -23,7 +23,7 @@ This package allows to benchmark search quality of a Lucene application.<p>In order to use this package you should provide:<ul>- <li>A <a href="../../search/Searcher.html">searcher</a>.</li>+ <li>A <a href="{@docRoot}/../core/org/apache/lucene/search/IndexSearcher.html">IndexSearcher</a>.</li><li><a href="QualityQuery.html">Quality queries</a>.</li><li><a href="Judge.html">Judging object</a>.</li><li><a href="utils/SubmissionReport.html">Reporting object</a>.</li>diff --git a/lucene/core/src/java/org/apache/lucene/index/DirectoryReader.java b/lucene/core/src/java/org/apache/lucene/index/DirectoryReader.javaindex 30785b0fcf2..d561a84d46b 100644--- a/lucene/core/src/java/org/apache/lucene/index/DirectoryReader.java+++ b/lucene/core/src/java/org/apache/lucene/index/DirectoryReader.java@@ -397,7 +397,7 @@ public abstract class DirectoryReader extends BaseCompositeReader<AtomicReader>** <p>If instead this reader is a near real-time reader* (ie, obtained by a call to {@link- * IndexWriter#getReader}, or by calling {@link #openIfChanged}+ * IndexReader#open(IndexWriter,boolean)}, or by calling {@link #openIfChanged}* on a near real-time reader), then this method checks if* either a new commmit has occurred, or any new* uncommitted changes have taken place via the writer.diff --git a/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java b/lucene/core/src/java/org/apache/lucene/index/IndexWriter.javaindex 93a77887f99..4b251a2be56 100644--- a/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java+++ b/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java@@ -2517,7 +2517,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {/** Commits all changes to the index, specifying a* commitUserData Map (String -> String). This just* calls {@link #prepareCommit(Map)} (if you didn't- * already call it) and then {@link #finishCommit}.+ * already call it) and then {@link #commit}.** <p><b>NOTE</b>: if this method hits an OutOfMemoryError* you should immediately close the writer. See <a@@ -3719,13 +3719,14 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {directory.makeLock(IndexWriter.WRITE_LOCK_NAME).release();}- /** If {@link #getReader} has been called (ie, this writer- * is in near real-time mode), then after a merge- * completes, this class can be invoked to warm the- * reader on the newly merged segment, before the merge- * commits. This is not required for near real-time- * search, but will reduce search latency on opening a- * new near real-time reader after a merge completes.+ /** If {@link IndexReader#open(IndexWriter,boolean)} has+ * been called (ie, this writer is in near real-time+ * mode), then after a merge completes, this class can be+ * invoked to warm the reader on the newly merged+ * segment, before the merge commits. This is not+ * required for near real-time search, but will reduce+ * search latency on opening a new near real-time reader+ * after a merge completes.** @lucene.experimental*diff --git a/lucene/misc/src/java/org/apache/lucene/store/NativeUnixDirectory.java b/lucene/misc/src/java/org/apache/lucene/store/NativeUnixDirectory.javaindex dba87965a1d..c34364f7a35 100644--- a/lucene/misc/src/java/org/apache/lucene/store/NativeUnixDirectory.java+++ b/lucene/misc/src/java/org/apache/lucene/store/NativeUnixDirectory.java@@ -43,7 +43,7 @@ import org.apache.lucene.store.IOContext.Context;* to the provided Directory instance.** <p>See <a- * href="../../../../../contrib-misc/overview-summary.html#NativeUnixDirectory">Overview</a>+ * href="{@docRoot}/overview-summary.html#NativeUnixDirectory">Overview</a>* for more details.** <p>To use this you must compilediff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParserBase.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParserBase.javaindex fb3f95445a7..80ce6ec24eb 100644--- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParserBase.java+++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParserBase.java@@ -88,7 +88,7 @@ public abstract class QueryParserBase {}/** Initializes a query parser. Called by the QueryParser constructor- * @param matchVersion Lucene version to match. See <a href="#version">above</a>.+ * @param matchVersion Lucene version to match. See <a href="QueryParser#version">here</a>.* @param f the default field for query terms.* @param a used to find terms in the query text.*/diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/QueryParser.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/QueryParser.javaindex a0b1accb123..7e35f8729b4 100644--- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/QueryParser.java+++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/QueryParser.java@@ -20,7 +20,7 @@ import org.apache.lucene.queryparser.surround.query.SrndTruncQuery;/*** This class is generated by JavaCC. The only method that clients should need- * to call is <a href="#parse">parse()</a>.+ * to call is {@link #parse}.*/public class QueryParser implements QueryParserConstants {diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/QueryParser.jj b/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/QueryParser.jjindex 8c64f095552..d8c123a4a2a 100644--- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/QueryParser.jj+++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/QueryParser.jj@@ -49,7 +49,7 @@ import org.apache.lucene.queryparser.surround.query.SrndTruncQuery;/*** This class is generated by JavaCC. The only method that clients should need- * to call is <a href="#parse">parse()</a>.+ * to call is {@link #parse}.*/public class QueryParser {