question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Change applyNull method to not final method

See original GitHub issue

The 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:closed
  • Created 4 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
asolntsevcommented, Aug 3, 2019

@Lewka Да, и было бы правильно разбить на 2 разных Condition. Поймите меня правильно: чем больше вещей я делаю не-final, тем больше создаю возможностей для всевозможных ошибок, которые мне же потом придётся разруливать. Я по своему богатому опыту уже предвижу, чем может аукнуться ваш вариант. Я каждый день читаю кучу жалоб типа “у меня какая-то магия происходит, не знаю как повторить, но иногда тесты падают.”

Ну ладно, дадим шанс. В этом конкретном случае изменение вроде не такое уж страшное. Посмотрим. 😃

Done in https://github.com/selenide/selenide/commit/219670b6ed0080ab1fe3e74af416b11d0d143cd0

0reactions
Lewkacommented, Jul 25, 2019

@asolntsev если только это разбить на 2 разных метода, и 2 разных condition. Даже если вы не согласны с нашим подходом, что помешает сделать метод не final?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found