From bc2ce6bc408c0bf309ea19ebc8454dceeb57ba2e Mon Sep 17 00:00:00 2001 From: Roman Chyla Date: Tue, 25 Feb 2020 12:30:05 -0500 Subject: [PATCH] Fix for the oob condition when processing author names --- .../solr/handler/batch/BatchProviderDumpAuthorNames.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/adsabs/src/java/org/apache/solr/handler/batch/BatchProviderDumpAuthorNames.java b/contrib/adsabs/src/java/org/apache/solr/handler/batch/BatchProviderDumpAuthorNames.java index e3fe5c2c9..02312038b 100644 --- a/contrib/adsabs/src/java/org/apache/solr/handler/batch/BatchProviderDumpAuthorNames.java +++ b/contrib/adsabs/src/java/org/apache/solr/handler/batch/BatchProviderDumpAuthorNames.java @@ -99,8 +99,8 @@ public void collect(int i) { String[] vals = d.getValues(f); for (String s: vals) { - //System.out.println(s); - //System.out.println(AuthorUtils.normalizeAuthor(s)); + System.out.println(s); + System.out.println(AuthorUtils.normalizeAuthor(s)); s = s.toLowerCase(); TokenStream ts = analyzer.tokenStream(targetAnalyzer, new StringReader(s)); @@ -290,7 +290,7 @@ private boolean shortened(String[]nameParts, String[][] otherNames) { if (nameParts[i].length() > 1) { nameParts[i] = nameParts[i].substring(0, 1); for (String[] other: otherNames) { - if (other[i] == null || other[i].length() < 2) + if (other.length <= i || other[i] == null || other[i].length() < 2) return false; // this may happen if synonyms map the name to a shorter version, my solution is to stop processing (cheap?) other[i] = other[i].substring(0, 1); }