fix(selector): the behavior of findOnce() is different from docs point out
This commit is contained in:
@@ -169,17 +169,6 @@ public class UiSelector extends UiGlobalSelector {
|
||||
|
||||
public UiObject findOnce(int index) {
|
||||
UiObjectCollection uiObjectCollection = find();
|
||||
while (uiObjectCollection.empty()) {
|
||||
if (Thread.currentThread().isInterrupted()) {
|
||||
throw new ScriptInterruptedException();
|
||||
}
|
||||
try {
|
||||
Thread.sleep(50);
|
||||
} catch (InterruptedException e) {
|
||||
throw new ScriptInterruptedException();
|
||||
}
|
||||
uiObjectCollection = find();
|
||||
}
|
||||
if (index >= uiObjectCollection.size()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user