Skip to content

Commit 3d049bc

Browse files
committed
Merge remote-tracking branch 'origin/feature/webelement-widget' into feature/webelement-widget
2 parents 402ac3d + 9a67c64 commit 3d049bc

31 files changed

+55
-61
lines changed

build.gradle

+8-7
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ plugins {
77
id 'maven-publish'
88
id 'jacoco'
99
id 'signing'
10-
id 'org.owasp.dependencycheck' version '12.1.0'
10+
id 'org.owasp.dependencycheck' version '12.1.1'
1111
id 'com.gradleup.shadow' version '8.3.6'
1212
}
1313

@@ -38,8 +38,8 @@ ext {
3838
}
3939

4040
dependencies {
41-
compileOnly 'org.projectlombok:lombok:1.18.36'
42-
annotationProcessor 'org.projectlombok:lombok:1.18.36'
41+
compileOnly 'org.projectlombok:lombok:1.18.38'
42+
annotationProcessor 'org.projectlombok:lombok:1.18.38'
4343

4444
if (project.hasProperty("isCI")) {
4545
api "org.seleniumhq.selenium:selenium-api:${seleniumVersion}"
@@ -65,8 +65,9 @@ dependencies {
6565
}
6666
}
6767
}
68-
implementation 'com.google.code.gson:gson:2.12.1'
68+
implementation 'com.google.code.gson:gson:2.13.0'
6969
implementation "org.slf4j:slf4j-api:${slf4jVersion}"
70+
implementation 'org.jspecify:jspecify:1.0.0'
7071
}
7172

7273
dependencyCheck {
@@ -195,7 +196,7 @@ testing {
195196
configureEach {
196197
useJUnitJupiter()
197198
dependencies {
198-
implementation 'org.junit.jupiter:junit-jupiter:5.12.0'
199+
implementation 'org.junit.jupiter:junit-jupiter:5.12.2'
199200
runtimeOnly 'org.junit.platform:junit-platform-launcher'
200201
implementation 'org.hamcrest:hamcrest:3.0'
201202
runtimeOnly "org.slf4j:slf4j-simple:${slf4jVersion}"
@@ -213,7 +214,7 @@ testing {
213214
test {
214215
dependencies {
215216
implementation "org.seleniumhq.selenium:selenium-chrome-driver:${seleniumVersion}"
216-
implementation('io.github.bonigarcia:webdrivermanager:5.9.3') {
217+
implementation('io.github.bonigarcia:webdrivermanager:6.0.1') {
217218
exclude group: 'org.seleniumhq.selenium'
218219
}
219220
}
@@ -257,7 +258,7 @@ testing {
257258
dependencies {
258259
implementation project()
259260
implementation(sourceSets.test.output)
260-
implementation('io.github.bonigarcia:webdrivermanager:5.9.3') {
261+
implementation('io.github.bonigarcia:webdrivermanager:6.0.1') {
261262
exclude group: 'org.seleniumhq.selenium'
262263
}
263264
}

src/main/java/io/appium/java_client/AppiumClientConfig.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818

1919
import io.appium.java_client.internal.filters.AppiumIdempotencyFilter;
2020
import io.appium.java_client.internal.filters.AppiumUserAgentFilter;
21+
import org.jspecify.annotations.Nullable;
2122
import org.openqa.selenium.Credentials;
2223
import org.openqa.selenium.internal.Require;
2324
import org.openqa.selenium.remote.http.ClientConfig;
2425
import org.openqa.selenium.remote.http.Filter;
2526

26-
import javax.annotation.Nullable;
2727
import javax.net.ssl.SSLContext;
2828
import java.net.Proxy;
2929
import java.net.URI;

src/main/java/io/appium/java_client/AppiumDriver.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import io.appium.java_client.service.local.AppiumDriverLocalService;
2626
import io.appium.java_client.service.local.AppiumServiceBuilder;
2727
import lombok.Getter;
28+
import org.jspecify.annotations.NonNull;
2829
import org.openqa.selenium.Capabilities;
2930
import org.openqa.selenium.ImmutableCapabilities;
3031
import org.openqa.selenium.OutputType;
@@ -47,7 +48,6 @@
4748
import org.openqa.selenium.remote.http.HttpClient;
4849
import org.openqa.selenium.remote.http.HttpMethod;
4950

50-
import javax.annotation.Nonnull;
5151
import java.net.URI;
5252
import java.net.URISyntaxException;
5353
import java.net.URL;
@@ -275,7 +275,7 @@ public Optional<BiDi> maybeGetBiDi() {
275275
}
276276

277277
@Override
278-
@Nonnull
278+
@NonNull
279279
public BiDi getBiDi() {
280280
var webSocketUrl = ((BaseOptions<?>) this.capabilities).getWebSocketUrl().orElseThrow(
281281
() -> {

src/main/java/io/appium/java_client/CommandExecutionHelper.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616

1717
package io.appium.java_client;
1818

19+
import org.jspecify.annotations.Nullable;
1920
import org.openqa.selenium.remote.Response;
2021

21-
import javax.annotation.Nullable;
2222
import java.util.Collections;
2323
import java.util.Map;
2424

src/main/java/io/appium/java_client/ComparesImages.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
import io.appium.java_client.imagecomparison.OccurrenceMatchingResult;
2424
import io.appium.java_client.imagecomparison.SimilarityMatchingOptions;
2525
import io.appium.java_client.imagecomparison.SimilarityMatchingResult;
26+
import org.jspecify.annotations.Nullable;
2627

27-
import javax.annotation.Nullable;
2828
import java.io.File;
2929
import java.io.IOException;
3030
import java.nio.file.Files;

src/main/java/io/appium/java_client/ExecuteCDPCommand.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616

1717
package io.appium.java_client;
1818

19+
import org.jspecify.annotations.Nullable;
1920
import org.openqa.selenium.remote.Response;
2021

21-
import javax.annotation.Nullable;
2222
import java.util.Collections;
2323
import java.util.HashMap;
2424
import java.util.Map;

src/main/java/io/appium/java_client/ExecutesDriverScript.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818

1919
import io.appium.java_client.driverscripts.ScriptOptions;
2020
import io.appium.java_client.driverscripts.ScriptValue;
21+
import org.jspecify.annotations.Nullable;
2122
import org.openqa.selenium.remote.Response;
2223

23-
import javax.annotation.Nullable;
2424
import java.util.HashMap;
2525
import java.util.Map;
2626

src/main/java/io/appium/java_client/InteractsWithApps.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
import io.appium.java_client.appmanagement.BaseOptions;
2323
import io.appium.java_client.appmanagement.BaseRemoveApplicationOptions;
2424
import io.appium.java_client.appmanagement.BaseTerminateApplicationOptions;
25+
import org.jspecify.annotations.Nullable;
2526
import org.openqa.selenium.InvalidArgumentException;
2627
import org.openqa.selenium.UnsupportedCommandException;
2728

28-
import javax.annotation.Nullable;
2929
import java.time.Duration;
3030
import java.util.HashMap;
3131
import java.util.Map;

src/main/java/io/appium/java_client/Location.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
1919
import lombok.EqualsAndHashCode;
2020
import lombok.Getter;
2121
import lombok.ToString;
22-
23-
import javax.annotation.Nullable;
22+
import org.jspecify.annotations.Nullable;
2423

2524
/**
2625
* Represents the physical location.

src/main/java/io/appium/java_client/MobileCommand.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
import io.appium.java_client.imagecomparison.ComparisonMode;
2222
import io.appium.java_client.screenrecording.BaseStartScreenRecordingOptions;
2323
import io.appium.java_client.screenrecording.BaseStopScreenRecordingOptions;
24+
import org.jspecify.annotations.Nullable;
2425
import org.openqa.selenium.remote.CommandInfo;
2526
import org.openqa.selenium.remote.http.HttpMethod;
2627

27-
import javax.annotation.Nullable;
2828
import java.nio.charset.StandardCharsets;
2929
import java.time.Duration;
3030
import java.util.Collections;

src/main/java/io/appium/java_client/android/StartsActivity.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,9 @@
1919
import io.appium.java_client.CanRememberExtensionPresence;
2020
import io.appium.java_client.CommandExecutionHelper;
2121
import io.appium.java_client.ExecutesMethod;
22+
import org.jspecify.annotations.Nullable;
2223
import org.openqa.selenium.UnsupportedCommandException;
2324

24-
import javax.annotation.Nullable;
25-
2625
import java.util.Map;
2726

2827
import static io.appium.java_client.MobileCommand.CURRENT_ACTIVITY;

src/main/java/io/appium/java_client/internal/CapabilityHelpers.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616

1717
package io.appium.java_client.internal;
1818

19+
import org.jspecify.annotations.Nullable;
1920
import org.openqa.selenium.Capabilities;
2021

21-
import javax.annotation.Nullable;
2222
import java.net.MalformedURLException;
2323
import java.net.URL;
2424
import java.time.Duration;

src/main/java/io/appium/java_client/internal/filters/AppiumUserAgentFilter.java

+3-4
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,13 @@
1717
package io.appium.java_client.internal.filters;
1818

1919
import io.appium.java_client.internal.Config;
20+
import org.jspecify.annotations.NonNull;
21+
import org.jspecify.annotations.Nullable;
2022
import org.openqa.selenium.remote.http.AddSeleniumUserAgent;
2123
import org.openqa.selenium.remote.http.Filter;
2224
import org.openqa.selenium.remote.http.HttpHandler;
2325
import org.openqa.selenium.remote.http.HttpHeader;
2426

25-
import javax.annotation.Nonnull;
26-
import javax.annotation.Nullable;
27-
2827
/**
2928
* Manage Appium Client configurations.
3029
*/
@@ -41,7 +40,7 @@ public class AppiumUserAgentFilter implements Filter {
4140
*/
4241
public static final String USER_AGENT = buildUserAgentHeaderValue(AddSeleniumUserAgent.USER_AGENT);
4342

44-
private static String buildUserAgentHeaderValue(@Nonnull String previousUA) {
43+
private static String buildUserAgentHeaderValue(@NonNull String previousUA) {
4544
return String.format("%s%s (%s)",
4645
USER_AGENT_PREFIX, Config.main().getValue(VERSION_KEY, String.class), previousUA);
4746
}

src/main/java/io/appium/java_client/pagefactory/AppiumElementLocatorFactory.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
import io.appium.java_client.pagefactory.bys.builder.AppiumByBuilder;
2020
import io.appium.java_client.pagefactory.locator.CacheableElementLocatorFactory;
2121
import io.appium.java_client.pagefactory.locator.CacheableLocator;
22+
import org.jspecify.annotations.Nullable;
2223
import org.openqa.selenium.SearchContext;
2324

24-
import javax.annotation.Nullable;
2525
import java.lang.ref.WeakReference;
2626
import java.lang.reflect.AnnotatedElement;
2727
import java.lang.reflect.Field;

src/main/java/io/appium/java_client/pagefactory/AppiumFieldDecorator.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
import io.appium.java_client.internal.CapabilityHelpers;
2020
import io.appium.java_client.pagefactory.bys.ContentType;
2121
import io.appium.java_client.pagefactory.locator.CacheableLocator;
22+
import org.jspecify.annotations.NonNull;
23+
import org.jspecify.annotations.Nullable;
2224
import org.openqa.selenium.HasCapabilities;
2325
import org.openqa.selenium.SearchContext;
2426
import org.openqa.selenium.WebDriver;
@@ -30,8 +32,6 @@
3032
import org.openqa.selenium.support.pagefactory.ElementLocatorFactory;
3133
import org.openqa.selenium.support.pagefactory.FieldDecorator;
3234

33-
import javax.annotation.Nonnull;
34-
import javax.annotation.Nullable;
3535
import java.lang.ref.WeakReference;
3636
import java.lang.reflect.Constructor;
3737
import java.lang.reflect.Field;
@@ -123,7 +123,7 @@ contextReference, duration, new WidgetByBuilder(platform, automation)
123123
);
124124
}
125125

126-
@Nonnull
126+
@NonNull
127127
private static WeakReference<WebDriver> requireWebDriverReference(SearchContext searchContext) {
128128
var wd = unpackObjectFromSearchContext(
129129
checkNotNull(searchContext, "The provided search context cannot be null"),

src/main/java/io/appium/java_client/pagefactory/WidgetInterceptor.java

+3-5
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
import io.appium.java_client.pagefactory.bys.ContentType;
2020
import io.appium.java_client.pagefactory.interceptors.InterceptorOfASingleElement;
2121
import io.appium.java_client.pagefactory.locator.CacheableLocator;
22+
import org.jspecify.annotations.Nullable;
2223
import org.openqa.selenium.WebDriver;
2324
import org.openqa.selenium.WebElement;
2425
import org.openqa.selenium.support.PageFactory;
2526

26-
import javax.annotation.Nullable;
2727
import java.lang.ref.WeakReference;
2828
import java.lang.reflect.Constructor;
2929
import java.lang.reflect.Method;
@@ -48,11 +48,9 @@ public class WidgetInterceptor extends InterceptorOfASingleElement {
4848
* Proxy interceptor class for widgets.
4949
*/
5050
public WidgetInterceptor(
51-
@Nullable
52-
CacheableLocator locator,
51+
@Nullable CacheableLocator locator,
5352
WeakReference<WebDriver> driverReference,
54-
@Nullable
55-
WeakReference<WebElement> cachedElementReference,
53+
@Nullable WeakReference<WebElement> cachedElementReference,
5654
Map<ContentType, Constructor<? extends Widget>> instantiationMap,
5755
Duration duration
5856
) {

src/main/java/io/appium/java_client/pagefactory/WidgetListInterceptor.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
import io.appium.java_client.pagefactory.bys.ContentType;
2020
import io.appium.java_client.pagefactory.interceptors.InterceptorOfAListOfElements;
2121
import io.appium.java_client.pagefactory.locator.CacheableLocator;
22+
import org.jspecify.annotations.Nullable;
2223
import org.openqa.selenium.WebDriver;
2324
import org.openqa.selenium.WebElement;
2425

25-
import javax.annotation.Nullable;
2626
import java.lang.ref.WeakReference;
2727
import java.lang.reflect.Constructor;
2828
import java.lang.reflect.Method;
@@ -50,8 +50,7 @@ public class WidgetListInterceptor extends InterceptorOfAListOfElements {
5050
* Proxy interceptor class for lists of widgets.
5151
*/
5252
public WidgetListInterceptor(
53-
@Nullable
54-
CacheableLocator locator,
53+
@Nullable CacheableLocator locator,
5554
WeakReference<WebDriver> driver,
5655
Map<ContentType, Constructor<? extends Widget>> instantiationMap,
5756
Class<? extends Widget> declaredType,

src/main/java/io/appium/java_client/pagefactory/bys/ContentMappedBy.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
package io.appium.java_client.pagefactory.bys;
1818

1919
import lombok.EqualsAndHashCode;
20+
import org.jspecify.annotations.NonNull;
2021
import org.openqa.selenium.By;
2122
import org.openqa.selenium.SearchContext;
2223
import org.openqa.selenium.WebElement;
2324

24-
import javax.annotation.Nonnull;
2525
import java.util.List;
2626
import java.util.Map;
2727

@@ -43,7 +43,7 @@ public ContentMappedBy(Map<ContentType, By> map) {
4343
* @param type required content type {@link ContentType}
4444
* @return self-reference.
4545
*/
46-
public By useContent(@Nonnull ContentType type) {
46+
public By useContent(@NonNull ContentType type) {
4747
requireNonNull(type);
4848
currentContent = type;
4949
return this;

src/main/java/io/appium/java_client/pagefactory/bys/builder/AppiumByBuilder.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616

1717
package io.appium.java_client.pagefactory.bys.builder;
1818

19+
import org.jspecify.annotations.Nullable;
1920
import org.openqa.selenium.By;
2021
import org.openqa.selenium.support.pagefactory.AbstractAnnotations;
2122
import org.openqa.selenium.support.pagefactory.ByAll;
2223

23-
import javax.annotation.Nullable;
2424
import java.lang.annotation.Annotation;
2525
import java.lang.reflect.AnnotatedElement;
2626
import java.lang.reflect.Constructor;

src/main/java/io/appium/java_client/pagefactory/interceptors/InterceptorOfAListOfElements.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
package io.appium.java_client.pagefactory.interceptors;
1818

1919
import io.appium.java_client.proxy.MethodCallListener;
20+
import org.jspecify.annotations.Nullable;
2021
import org.openqa.selenium.WebElement;
2122
import org.openqa.selenium.support.pagefactory.ElementLocator;
2223

23-
import javax.annotation.Nullable;
2424
import java.lang.reflect.Method;
2525
import java.util.ArrayList;
2626
import java.util.List;

src/main/java/io/appium/java_client/pagefactory/interceptors/InterceptorOfASingleElement.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
package io.appium.java_client.pagefactory.interceptors;
1818

1919
import io.appium.java_client.proxy.MethodCallListener;
20+
import org.jspecify.annotations.Nullable;
2021
import org.openqa.selenium.WebDriver;
2122
import org.openqa.selenium.WebElement;
2223
import org.openqa.selenium.WrapsDriver;
2324
import org.openqa.selenium.remote.RemoteWebElement;
2425
import org.openqa.selenium.support.pagefactory.ElementLocator;
2526

26-
import javax.annotation.Nullable;
2727
import java.lang.ref.WeakReference;
2828
import java.lang.reflect.Method;
2929
import java.util.Objects;
@@ -34,8 +34,7 @@ public abstract class InterceptorOfASingleElement implements MethodCallListener
3434
private final WeakReference<WebDriver> driverReference;
3535

3636
public InterceptorOfASingleElement(
37-
@Nullable
38-
ElementLocator locator,
37+
@Nullable ElementLocator locator,
3938
WeakReference<WebDriver> driverReference
4039
) {
4140
this.locator = locator;

src/main/java/io/appium/java_client/pagefactory/utils/WebDriverUnpackUtility.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,13 @@
1818

1919
import io.appium.java_client.HasBrowserCheck;
2020
import io.appium.java_client.pagefactory.bys.ContentType;
21+
import org.jspecify.annotations.Nullable;
2122
import org.openqa.selenium.ContextAware;
2223
import org.openqa.selenium.SearchContext;
2324
import org.openqa.selenium.WebDriver;
2425
import org.openqa.selenium.WrapsDriver;
2526
import org.openqa.selenium.WrapsElement;
2627

27-
import javax.annotation.Nullable;
28-
2928
import java.util.Optional;
3029

3130
import static io.appium.java_client.HasBrowserCheck.NATIVE_CONTEXT;

0 commit comments

Comments
 (0)