Skip to content

Commit

Permalink
[bugfix] addressing PR review
Browse files Browse the repository at this point in the history
  • Loading branch information
marmoure committed Nov 23, 2023
1 parent a2344d7 commit eacb784
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -263,10 +263,11 @@ private void fetchjButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-

for (final AutoComplete autoComplete : teiCompleter.getConfiguration().getAutoCompletes()) {
//check if attributeExpr addresses a subset of autoCompleteXPaths.attributeXPath
// only request auto completer suggestions if it matches
final TeiCompleter.AutoCompleteXPaths autoCompleteXPaths = teiCompleter.getXPaths(autoComplete);
if (!isSubset(attributeExpr, autoCompleteXPaths.getAttributeXPath())) continue;

suggestions.addAll(teiCompleter.requestAutoComplete(autoComplete, selection, dependent));
if (isSubset(attributeExpr, autoCompleteXPaths.getAttributeXPath())) {
suggestions.addAll(teiCompleter.requestAutoComplete(autoComplete, selection, dependent));
}
}

//get the model to populate the table
Expand Down Expand Up @@ -424,10 +425,12 @@ protected Object doInBackground() throws Exception {

for (final AutoComplete autoComplete : teiCompleter.getConfiguration().getAutoCompletes()) {
//check if attributeExpr addresses a subset of autoCompleteXPaths.attributeXPath
// only request auto complete suggestions if it matches
final TeiCompleter.AutoCompleteXPaths autoCompleteXPaths = teiCompleter.getXPaths(autoComplete);
if (!isSubset(attributeExpr, autoCompleteXPaths.getAttributeXPath())) continue;
if (isSubset(attributeExpr, autoCompleteXPaths.getAttributeXPath())) {
suggestions.addAll(teiCompleter.requestAutoComplete(autoComplete, selection, dependent));

suggestions.addAll(teiCompleter.requestAutoComplete(autoComplete, selection, dependent));
}
}

this.suggestions.addAll(suggestions);
Expand Down

0 comments on commit eacb784

Please sign in to comment.