Skip to content

Commit 2846c1f

Browse files
authored
Merge branch 'trunk' into final-python-pagesize-support
2 parents 4a27588 + 3358983 commit 2846c1f

File tree

437 files changed

+520
-28325
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

437 files changed

+520
-28325
lines changed

MODULE.bazel

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,9 @@ maven.install(
224224
"org.zeromq:jeromq:0.6.0",
225225
],
226226
boms = [
227-
"io.opentelemetry:opentelemetry-bom:1.44.1",
228-
"io.netty:netty-bom:4.1.115.Final",
229-
"org.junit:junit-bom:5.11.3",
227+
"io.opentelemetry:opentelemetry-bom:1.46.0",
228+
"io.netty:netty-bom:4.1.117.Final",
229+
"org.junit:junit-bom:5.11.4",
230230
],
231231
excluded_artifacts = [
232232
"org.hamcrest:hamcrest-all", # Replaced by hamcrest 2

dotnet/NuGet.Config

Lines changed: 0 additions & 6 deletions
This file was deleted.

dotnet/private/merge_assemblies.bzl

Lines changed: 0 additions & 97 deletions
This file was deleted.

dotnet/private/nuget.bzl

Lines changed: 0 additions & 150 deletions
This file was deleted.

dotnet/src/webdriver/Interactions/ActionBuilder.cs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
using System.Collections.Generic;
2222
using System.Text;
2323

24+
#nullable enable
25+
2426
namespace OpenQA.Selenium.Interactions
2527
{
2628
/// <summary>
@@ -29,7 +31,7 @@ namespace OpenQA.Selenium.Interactions
2931
/// </summary>
3032
public class ActionBuilder
3133
{
32-
private Dictionary<InputDevice, ActionSequence> sequences = new Dictionary<InputDevice, ActionSequence>();
34+
private readonly Dictionary<InputDevice, ActionSequence> sequences = new Dictionary<InputDevice, ActionSequence>();
3335

3436
/// <summary>
3537
/// Adds an action to the built set of actions. Adding an action will
@@ -71,7 +73,7 @@ public IList<ActionSequence> ToActionSequenceList()
7173
/// </summary>
7274
public void ClearSequences()
7375
{
74-
this.sequences = new Dictionary<InputDevice, ActionSequence>();
76+
this.sequences.Clear();
7577
}
7678

7779
/// <summary>
@@ -94,8 +96,7 @@ private void ProcessTick(params Interaction[] interactionsToAdd)
9496
List<InputDevice> usedDevices = new List<InputDevice>();
9597
foreach (Interaction interaction in interactionsToAdd)
9698
{
97-
InputDevice actionDevice = interaction.SourceDevice;
98-
if (usedDevices.Contains(actionDevice))
99+
if (usedDevices.Contains(interaction.SourceDevice))
99100
{
100101
throw new ArgumentException("You can only add one action per device for a single tick.");
101102
}
@@ -104,8 +105,9 @@ private void ProcessTick(params Interaction[] interactionsToAdd)
104105
List<InputDevice> unusedDevices = new List<InputDevice>(this.sequences.Keys);
105106
foreach (Interaction interaction in interactionsToAdd)
106107
{
107-
ActionSequence sequence = this.FindSequence(interaction.SourceDevice);
108+
ActionSequence sequence = this.GetOrAddSequence(interaction.SourceDevice);
108109
sequence.AddAction(interaction);
110+
109111
unusedDevices.Remove(interaction.SourceDevice);
110112
}
111113

@@ -116,11 +118,11 @@ private void ProcessTick(params Interaction[] interactionsToAdd)
116118
}
117119
}
118120

119-
private ActionSequence FindSequence(InputDevice device)
121+
private ActionSequence GetOrAddSequence(InputDevice device)
120122
{
121-
if (this.sequences.ContainsKey(device))
123+
if (this.sequences.TryGetValue(device, out ActionSequence? existingSequence))
122124
{
123-
return this.sequences[device];
125+
return existingSequence;
124126
}
125127

126128
int longestSequenceLength = 0;

0 commit comments

Comments
 (0)