Skip to content

Commit d8b7d32

Browse files
committed
ClassUtil: search among the multiple words in the repository name
for a name that matches a subURL of javadoc.scijava.org
1 parent 3020432 commit d8b7d32

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/org/scijava/ui/swing/script/ClassUtil.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ static public HashMap<String, ArrayList<String>> findDocumentationForClass(final
121121
String scijava_javadoc_url = scijava_javadoc_URLs.get(props.name.toLowerCase());
122122
if (null == scijava_javadoc_url) {
123123
// Try cropping name at the first whitespace if any (e.g. "ImgLib2 Core Library" to "ImgLib2")
124-
final int ispace = props.name.indexOf(' ');
125-
if (-1 != ispace) {
126-
scijava_javadoc_url = scijava_javadoc_URLs.get(props.name.toLowerCase().substring(0, ispace));
124+
for (final String word: props.name.split(" ")) {
125+
scijava_javadoc_url = scijava_javadoc_URLs.get(word.toLowerCase());
126+
if (null != scijava_javadoc_url) break; // found a valid one
127127
}
128128
}
129129
if (null != scijava_javadoc_url) {

0 commit comments

Comments
 (0)