Skip to content

Commit 16feae5

Browse files
committed
Add missing override annotations in Select class
1 parent 9a86ab8 commit 16feae5

File tree

1 file changed

+11
-1
lines changed
  • java/client/src/org/openqa/selenium/support/ui

1 file changed

+11
-1
lines changed

java/client/src/org/openqa/selenium/support/ui/Select.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
/**
2929
* Models a SELECT tag, providing helper methods to select and deselect options.
3030
*/
31-
public class Select implements ISelect{
31+
public class Select implements ISelect {
3232

3333
private final WebElement element;
3434
private final boolean isMulti;
@@ -59,20 +59,23 @@ public Select(WebElement element) {
5959
* @return Whether this select element support selecting multiple options at the same time? This
6060
* is done by checking the value of the "multiple" attribute.
6161
*/
62+
@Override
6263
public boolean isMultiple() {
6364
return isMulti;
6465
}
6566

6667
/**
6768
* @return All options belonging to this select tag
6869
*/
70+
@Override
6971
public List<WebElement> getOptions() {
7072
return element.findElements(By.tagName("option"));
7173
}
7274

7375
/**
7476
* @return All selected options belonging to this select tag
7577
*/
78+
@Override
7679
public List<WebElement> getAllSelectedOptions() {
7780
List<WebElement> toReturn = new ArrayList<>();
7881

@@ -90,6 +93,7 @@ public List<WebElement> getAllSelectedOptions() {
9093
* normal select)
9194
* @throws NoSuchElementException If no option is selected
9295
*/
96+
@Override
9397
public WebElement getFirstSelectedOption() {
9498
for (WebElement option : getOptions()) {
9599
if (option.isSelected()) {
@@ -171,6 +175,7 @@ private String getLongestSubstringWithoutSpace(String s) {
171175
* @param index The option at this index will be selected
172176
* @throws NoSuchElementException If no matching option elements are found
173177
*/
178+
@Override
174179
public void selectByIndex(int index) {
175180
String match = String.valueOf(index);
176181

@@ -192,6 +197,7 @@ public void selectByIndex(int index) {
192197
* @param value The value to match against
193198
* @throws NoSuchElementException If no matching option elements are found
194199
*/
200+
@Override
195201
public void selectByValue(String value) {
196202
List<WebElement> options = element.findElements(By.xpath(
197203
".//option[@value = " + Quotes.escape(value) + "]"));
@@ -215,6 +221,7 @@ public void selectByValue(String value) {
215221
*
216222
* @throws UnsupportedOperationException If the SELECT does not support multiple selections
217223
*/
224+
@Override
218225
public void deselectAll() {
219226
if (!isMultiple()) {
220227
throw new UnsupportedOperationException(
@@ -236,6 +243,7 @@ public void deselectAll() {
236243
* @throws NoSuchElementException If no matching option elements are found
237244
* @throws UnsupportedOperationException If the SELECT does not support multiple selections
238245
*/
246+
@Override
239247
public void deselectByValue(String value) {
240248
if (!isMultiple()) {
241249
throw new UnsupportedOperationException(
@@ -262,6 +270,7 @@ public void deselectByValue(String value) {
262270
* @throws NoSuchElementException If no matching option elements are found
263271
* @throws UnsupportedOperationException If the SELECT does not support multiple selections
264272
*/
273+
@Override
265274
public void deselectByIndex(int index) {
266275
if (!isMultiple()) {
267276
throw new UnsupportedOperationException(
@@ -289,6 +298,7 @@ public void deselectByIndex(int index) {
289298
* @throws NoSuchElementException If no matching option elements are found
290299
* @throws UnsupportedOperationException If the SELECT does not support multiple selections
291300
*/
301+
@Override
292302
public void deselectByVisibleText(String text) {
293303
if (!isMultiple()) {
294304
throw new UnsupportedOperationException(

0 commit comments

Comments
 (0)