Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ dependencies {
### Compatibility Matrix
Appium Java Client | Selenium client
----------------------------------------------------------------------------------------------------|-----------------------------
`next` (not released yet) | `4.36.0`
`10.0.0` | `4.35.0`, `4.36.0`
`9.5.0` | `4.34.0`
`9.4.0` | `4.26.0`, `4.27.0`, `4.28.0`, `4.28.1`, `4.29.0`, `4.30.0`, `4.31.0`, `4.32.0`, `4.33.0`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,4 @@ public static <T> T setPrivateFieldValue(Class<?> cls, T target, String fieldNam
}
return target;
}

/**
* Fetches the value of a private instance field.
*
* @param cls The target class or a superclass.
* @param target Target instance.
* @param fieldName Target field name.
* @param fieldType Field type.
* @return The retrieved field value.
*/
public static <T> T getPrivateFieldValue(Class<?> cls, Object target, String fieldName, Class<T> fieldType) {
try {
final Field f = cls.getDeclaredField(fieldName);
f.setAccessible(true);
return fieldType.cast(f.get(target));
} catch (NoSuchFieldException | IllegalAccessException e) {
throw new WebDriverException(e);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,6 @@ public AppiumCommandExecutor(Map<String, CommandInfo> additionalCommands,
this(additionalCommands, service, HttpClient.Factory.createDefault(), appiumClientConfig);
}

@Deprecated
@SuppressWarnings("SameParameterValue")
protected <B> B getPrivateFieldValue(
Class<? extends CommandExecutor> cls, String fieldName, Class<B> fieldType) {
return ReflectionHelpers.getPrivateFieldValue(cls, this, fieldName, fieldType);
}

@Deprecated
@SuppressWarnings("SameParameterValue")
protected void setPrivateFieldValue(
Expand All @@ -134,12 +127,11 @@ protected void setPrivateFieldValue(
}

public Map<String, CommandInfo> getAdditionalCommands() {
//noinspection unchecked
return getPrivateFieldValue(HttpCommandExecutor.class, "additionalCommands", Map.class);
return additionalCommands;
}

public Factory getHttpClientFactory() {
return getPrivateFieldValue(HttpCommandExecutor.class, "httpClientFactory", Factory.class);
return httpClientFactory;
}

@Nullable
Expand Down