Change applyNull method to not final method
See original GitHub issueThe problem
Hi. Could you change method
public final boolean applyNull()
In Condtion
class to not final method? Cause we’ve faced situation, when element doesn’t exist on the page, and I wanna check something else in my custom condition, and now all I can do, it’s just pass an argument true
to Condition
constructor, and then i’ll get a null
instead of error. But it’s not what we want.
We want to check another condition. smt like this
public boolean applyNull() {
return true;
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
final String class vs final methods of Non-final String class
String class is declared as final for security and performance related reasons. What I'm not understanding is the part that whether same purpose ......
Read more >Writing Final Classes and Methods (The Java™ Tutorials ...
You can declare some or all of a class's methods final. You use the final keyword in a method declaration to indicate that...
Read more >Function.prototype.apply() - JavaScript - MDN Web Docs
The apply() method calls the specified function with a given this value, and arguments provided as an array (or an array-like object).
Read more >JavaScript Function apply() Method - W3Schools
Method Reuse. With the apply() method, you can write a method that can be used on different objects. The JavaScript apply() Method. The...
Read more >A look at the Optional datatype in Java and some anti-patterns ...
If a user of this function looks at its definition, they do not stand a chance to know this method could return a...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Lewka Да, и было бы правильно разбить на 2 разных Condition. Поймите меня правильно: чем больше вещей я делаю не-final, тем больше создаю возможностей для всевозможных ошибок, которые мне же потом придётся разруливать. Я по своему богатому опыту уже предвижу, чем может аукнуться ваш вариант. Я каждый день читаю кучу жалоб типа “у меня какая-то магия происходит, не знаю как повторить, но иногда тесты падают.”
Ну ладно, дадим шанс. В этом конкретном случае изменение вроде не такое уж страшное. Посмотрим. 😃
Done in https://github.com/selenide/selenide/commit/219670b6ed0080ab1fe3e74af416b11d0d143cd0
@asolntsev если только это разбить на 2 разных метода, и 2 разных condition. Даже если вы не согласны с нашим подходом, что помешает сделать метод не
final
?