Checklist
Description
In SeleniumHQ/selenium#15884 I made some Selenium APIs protected this way we no longer require reflection to do modifications.
Reflection can therefore likely be removed in
|
public static class CustomizableJsonToWebElementConverter extends JsonToWebElementConverter |
|
{ |
|
// Can be removed once https://github.com/SeleniumHQ/selenium/issues/15884 is fixed |
|
private final Method mSetOwner; |
|
private final Supplier<RemoteWebElement> remoteWebElementSupplier; |
|
|
|
public CustomizableJsonToWebElementConverter( |
|
final RemoteWebDriver driver, |
|
final Supplier<RemoteWebElement> remoteWebElementSupplier) |
|
{ |
|
super(driver); |
|
|
|
try |
|
{ |
|
this.mSetOwner = JsonToWebElementConverter.class.getDeclaredMethod("setOwner", RemoteWebElement.class); |
|
this.mSetOwner.setAccessible(true); |
|
} |
|
catch(final NoSuchMethodException ex) |
|
{ |
|
throw new IllegalStateException("Failed to find setOwner", ex); |
|
} |
|
this.remoteWebElementSupplier = remoteWebElementSupplier; |
|
} |
|
|
|
@Override |
|
protected RemoteWebElement newRemoteWebElement() |
|
{ |
|
try |
|
{ |
|
return (RemoteWebElement)this.mSetOwner.invoke(this, this.remoteWebElementSupplier.get()); |
|
} |
|
catch(final IllegalAccessException | InvocationTargetException e) |
|
{ |
|
throw new IllegalStateException("Failed to call setOwner", e); |
|
} |
|
} |
|
} |
Additional information
No response
Checklist
Description
In SeleniumHQ/selenium#15884 I made some Selenium APIs
protectedthis way we no longer require reflection to do modifications.Reflection can therefore likely be removed in
selenium-elements/selenium-elements/src/main/java/software/xdev/selenium/elements/remote/CustomizableRemoteWebElementInstaller.java
Lines 52 to 88 in 4ef0112
Additional information
No response