Skip to content

Commit

Permalink
Remove forced architecture flag
Browse files Browse the repository at this point in the history
  • Loading branch information
bonigarcia committed Sep 17, 2021
1 parent 6598041 commit 2c2669d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
5 changes: 1 addition & 4 deletions src/main/java/io/github/bonigarcia/wdm/WebDriverManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ public abstract class WebDriverManager {
protected DockerService dockerService;

protected boolean mirrorLog;
protected boolean forcedArch;
protected int retryCount = 0;
protected Capabilities capabilities;
protected boolean shutdownHook = false;
Expand Down Expand Up @@ -482,7 +481,6 @@ public WebDriverManager browserVersion(String browserVersion) {

public WebDriverManager architecture(Architecture architecture) {
config().setArchitecture(architecture);
forcedArch = true;
return this;
}

Expand Down Expand Up @@ -690,7 +688,6 @@ public WebDriverManager browserVersionDetectionRegex(String regex) {
public void reset() {
config().reset();
mirrorLog = false;
forcedArch = false;
retryCount = 0;
shutdownHook = false;
dockerEnabled = false;
Expand Down Expand Up @@ -1198,7 +1195,7 @@ protected UrlHandler createUrlHandler(String driverVersion)
}

// Rest of filters
urlHandler.filterByArch(architecture, forcedArch);
urlHandler.filterByArch(architecture);
urlHandler.filterByIgnoredVersions(config().getIgnoreVersions());
urlHandler.filterByBeta(config().isUseBetaVersions());

Expand Down
7 changes: 3 additions & 4 deletions src/main/java/io/github/bonigarcia/wdm/online/UrlHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -147,21 +147,20 @@ public void filterByOs(String driverName, String osName) {
}
}

public void filterByArch(Architecture arch, boolean forcedArch) {
public void filterByArch(Architecture arch) {
log.trace("URLs before filtering by architecture ({}): {}", arch,
candidateUrls);

candidateUrls = config.getArchitecture().filterArm64(candidateUrls);

if (forcedArch && candidateUrls.size() > 1 && arch != null) {
if (candidateUrls.size() > 1 && arch != null) {
candidateUrls = candidateUrls.stream().filter(arch::matchUrl)
.collect(toList());
}
log.trace("URLs after filtering by architecture ({}): {}", arch,
candidateUrls);

if (candidateUrls.isEmpty() && !forcedArch
&& !candidateUrls.isEmpty()) {
if (candidateUrls.isEmpty() && !candidateUrls.isEmpty()) {
candidateUrls = singletonList(
candidateUrls.get(candidateUrls.size() - 1));
log.trace(
Expand Down

0 comments on commit 2c2669d

Please sign in to comment.