8231122: @index tag with newline causes tag search to fail
Reviewed-by: jjg
This commit is contained in:
parent
a63b541842
commit
8743f0b6d1
@ -110,7 +110,8 @@ public class TagletWriterImpl extends TagletWriter {
|
|||||||
|
|
||||||
String tagText = ch.getText(itt.getSearchTerm());
|
String tagText = ch.getText(itt.getSearchTerm());
|
||||||
if (tagText.charAt(0) == '"' && tagText.charAt(tagText.length() - 1) == '"') {
|
if (tagText.charAt(0) == '"' && tagText.charAt(tagText.length() - 1) == '"') {
|
||||||
tagText = tagText.substring(1, tagText.length() - 1);
|
tagText = tagText.substring(1, tagText.length() - 1)
|
||||||
|
.replaceAll("\\s+", " ");
|
||||||
}
|
}
|
||||||
String desc = ch.getText(itt.getDescription());
|
String desc = ch.getText(itt.getDescription());
|
||||||
|
|
||||||
|
@ -312,7 +312,7 @@ public class Links {
|
|||||||
* @return a valid HTML name
|
* @return a valid HTML name
|
||||||
*/
|
*/
|
||||||
public String getName(String name) {
|
public String getName(String name) {
|
||||||
return name.replaceAll(" +", "");
|
return name.replaceAll("\\s+", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -149,11 +149,12 @@ public class TestSearchScript extends JavadocTester {
|
|||||||
checkSearch(inv, "operty", List.of());
|
checkSearch(inv, "operty", List.of());
|
||||||
|
|
||||||
// search tag
|
// search tag
|
||||||
checkSearch(inv, "search tag", List.of("search tag"));
|
checkSearch(inv, "search tag", List.of("multiline search tag", "search tag"));
|
||||||
checkSearch(inv, "search tag", List.of("search tag"));
|
checkSearch(inv, "search tag", List.of("multiline search tag", "search tag"));
|
||||||
checkSearch(inv, "search ", List.of("search tag"));
|
checkSearch(inv, "search ", List.of("multiline search tag", "search tag"));
|
||||||
checkSearch(inv, "tag", List.of("search tag"));
|
checkSearch(inv, "tag", List.of("multiline search tag", "search tag"));
|
||||||
checkSearch(inv, "sea", List.of("search tag"));
|
checkSearch(inv, "sea", List.of("multiline search tag", "search tag"));
|
||||||
|
checkSearch(inv, "multi", List.of("multiline search tag"));
|
||||||
checkSearch(inv, "ear", List.of());
|
checkSearch(inv, "ear", List.of());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -244,7 +245,7 @@ public class TestSearchScript extends JavadocTester {
|
|||||||
List.of("listpkg.List.of(E, E, E, E)", "listpkg.List.of(E, E, E, E, E)"));
|
List.of("listpkg.List.of(E, E, E, E)", "listpkg.List.of(E, E, E, E, E)"));
|
||||||
checkSearch(inv, "l . o (e,e,e,",
|
checkSearch(inv, "l . o (e,e,e,",
|
||||||
List.of("listpkg.List.of(E, E, E, E)", "listpkg.List.of(E, E, E, E, E)"));
|
List.of("listpkg.List.of(E, E, E, E)", "listpkg.List.of(E, E, E, E, E)"));
|
||||||
checkSearch(inv, "search \tt", List.of("search tag"));
|
checkSearch(inv, "search \tt", List.of("other search tag"));
|
||||||
checkSearch(inv, "sear ch", List.of());
|
checkSearch(inv, "sear ch", List.of());
|
||||||
checkSearch(inv, "( e ..", List.of("listpkg.List.of(E...)"));
|
checkSearch(inv, "( e ..", List.of("listpkg.List.of(E...)"));
|
||||||
checkSearch(inv, "( i [ ]", List.of("listpkg.Nolist.withArrayArg(int[])"));
|
checkSearch(inv, "( i [ ]", List.of("listpkg.Nolist.withArrayArg(int[])"));
|
||||||
|
@ -27,9 +27,8 @@ import java.util.Collection;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Example class containing "list" but not matching at any word boundary.
|
* Example class containing "list" but not matching at any word boundary. {@index "other
|
||||||
*
|
* search tag"}.
|
||||||
* {@index "search tag"}.
|
|
||||||
*/
|
*/
|
||||||
public class Nolist {
|
public class Nolist {
|
||||||
|
|
||||||
|
@ -25,6 +25,13 @@ package mappkg;
|
|||||||
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Map interface.
|
||||||
|
*
|
||||||
|
* {@index "multiline
|
||||||
|
* search
|
||||||
|
* tag"}
|
||||||
|
*/
|
||||||
public interface Map {
|
public interface Map {
|
||||||
public void put(Object key, Object value);
|
public void put(Object key, Object value);
|
||||||
public boolean contains(Object key);
|
public boolean contains(Object key);
|
||||||
|
Loading…
Reference in New Issue
Block a user