Skip to content

Commit

Permalink
replace some deprecated usages.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbien committed Jan 13, 2023
1 parent 59cf3a9 commit c7b719f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
import org.apache.maven.wagon.authentication.AuthenticationException;
import org.apache.maven.wagon.authentication.AuthenticationInfo;
import org.apache.maven.wagon.authorization.AuthorizationException;
import org.apache.maven.wagon.events.TransferEvent;
import org.apache.maven.wagon.events.TransferListener;
import org.apache.maven.wagon.providers.http.HttpWagon;
import org.apache.maven.wagon.proxy.ProxyInfo;
Expand Down Expand Up @@ -429,29 +428,27 @@ private boolean loadIndexingContext2(final RepositoryInfo info) throws IOExcepti
}
}

int oldMax = BooleanQuery.getMaxClauseCount();
int oldMax = IndexSearcher.getMaxClauseCount();
try {
int max = oldMax;
while (true) {
IteratorSearchResponse response;
try {
BooleanQuery.setMaxClauseCount(max);
IndexSearcher.setMaxClauseCount(max);
response = searcher.searchIteratorPaged(isr, contexts);
LOGGER.log(Level.FINE, "passed on {0} clauses processing {1} with {2} hits", new Object[] {max, q, response.getTotalHitsCount()});
return response;
} catch (BooleanQuery.TooManyClauses exc) {
} catch (IndexSearcher.TooManyClauses exc) {
LOGGER.log(Level.FINE, "TooManyClauses on {0} clauses processing {1}", new Object[] {max, q});
max *= 2;
if (max > MAX_MAX_CLAUSE) {
LOGGER.log(Level.WARNING, "Encountered more than {0} clauses processing {1}", new Object[] {MAX_MAX_CLAUSE, q});
return null;
} else {
continue;
}
}
}
} finally {
BooleanQuery.setMaxClauseCount(oldMax);
IndexSearcher.setMaxClauseCount(oldMax);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,9 @@ public List<RepositoryInfo> getRepositoryInfos() {
final Settings settings = embedder2.getSettings();
for (Mirror mirror : settings.getMirrors()) {
String mirrorOf = mirror.getMirrorOf();
selectorWithGroups.add(mirror.getId(), mirror.getUrl(), mirror.getLayout(), false, mirrorOf, mirror.getMirrorOfLayouts());
selectorWithGroups.add(mirror.getId(), mirror.getUrl(), mirror.getLayout(), false, false, mirrorOf, mirror.getMirrorOfLayouts());
if (!mirrorOf.contains("*")) {
selectorWithoutGroups.add(mirror.getId(), mirror.getUrl(), mirror.getLayout(), false, mirrorOf, mirror.getMirrorOfLayouts());
selectorWithoutGroups.add(mirror.getId(), mirror.getUrl(), mirror.getLayout(), false, false, mirrorOf, mirror.getMirrorOfLayouts());
}
}

Expand Down

0 comments on commit c7b719f

Please sign in to comment.