Skip to content

Commit

Permalink
[java] Fixing use of deprecated methods
Browse files Browse the repository at this point in the history
  • Loading branch information
barancev committed Nov 5, 2019
1 parent 9923436 commit 5c70fc3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion java/client/src/org/openqa/selenium/remote/Augmenter.java
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ protected <X> X performAugmentation(CompoundHandler handler, X from) {
.asSubclass(from.getClass());

try {
return (X) loaded.newInstance();
return (X) loaded.getDeclaredConstructor().newInstance();
} catch (ReflectiveOperationException e) {
throw new RuntimeException("Unable to create subclass", e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ private static <T> T instantiatePage(WebDriver driver, Class<T> pageClassToProxy
Constructor<T> constructor = pageClassToProxy.getConstructor(WebDriver.class);
return constructor.newInstance(driver);
} catch (NoSuchMethodException e) {
return pageClassToProxy.newInstance();
return pageClassToProxy.getDeclaredConstructor().newInstance();
}
} catch (ReflectiveOperationException e) {
throw new RuntimeException(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public By buildBy() {
try {
builder = annotation.annotationType()
.getAnnotation(PageFactoryFinder.class).value()
.newInstance();
.getDeclaredConstructor().newInstance();
} catch (ReflectiveOperationException e) {
// Fall through.
}
Expand Down

0 comments on commit 5c70fc3

Please sign in to comment.