Skip to content

Commit

Permalink
Change static class member of ConsoleHasLabel to non static, fixes ec…
Browse files Browse the repository at this point in the history
…lipse-archived#2162

Signed-off-by: Ondrej Dockal <[email protected]>
  • Loading branch information
odockal committed Feb 25, 2022
1 parent c5a50ef commit 1eb7ee1
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
public class ConsoleHasLabel extends AbstractWaitCondition {

private Matcher<String> matcher;
private static ConsoleView consoleView = null;
private ConsoleView consoleView;
private String resultLabel;

/**
Expand All @@ -53,7 +53,7 @@ public ConsoleHasLabel(Matcher<String> matcher) {
*/
@Override
public boolean test() {
String consoleLabel = ConsoleHasLabel.getConsoleLabel();
String consoleLabel = getConsoleLabel();
if (matcher.matches(consoleLabel)) {
this.resultLabel = consoleLabel;
return true;
Expand All @@ -69,11 +69,13 @@ public String description() {
return "console label matches '" + matcher ;
}

private static String getConsoleLabel() {
private String getConsoleLabel() {
if (consoleView == null){
consoleView = new ConsoleView();
}
consoleView.open();
if (!consoleView.isOpen()) {
consoleView.open();
}
return consoleView.getConsoleLabel();
}

Expand Down

0 comments on commit 1eb7ee1

Please sign in to comment.