<commit_before>package org.jboss.reddeer.swt.condition;

import org.eclipse.swt.widgets.Shell;
import org.hamcrest.Matcher;
import org.hamcrest.core.IsEqual;
import org.jboss.reddeer.common.logging.Logger;
import org.jboss.reddeer.swt.lookup.ShellLookup;
import org.jboss.reddeer.swt.matcher.WithTextMatcher;
import org.jboss.reddeer.swt.util.internal.InstanceValidator;

/**
 * Condition is met when shell with specific text (title) is available.
 * 
 * @author <NAME> (<EMAIL>)
 * @author jniederm
 */
public class ShellWithTextIsAvailable implements WaitCondition { 
	private Matcher<String> matcher;
	private final Logger log = Logger.getLogger(this.getClass());

	/**
	 * Constructs ShellWithTextIsAvailable wait condition.
	 * Condition is met when shell with the specified title is available.
	 * 
	 * @param text text/name of the shell
	 */
	public ShellWithTextIsAvailable(String title) {
		InstanceValidator.checkNotNull(title, "title");
		this.matcher = new IsEqual<String>(title);
	}

	@Override
	public boolean test() {
		log.debug("Looking for shell with title matching '" + matcher + "'");
		Shell shell = ShellLookup.getInstance().getShell(matcher);
		return shell != null;
	}

	@Override
	public String description() {
		return "shell with title matching " + matcher + " is available";
	}
}<commit_msg>Use right matcher for matching shell title. Fixes #713<commit_after>package org.jboss.reddeer.swt.condition;

import org.eclipse.swt.widgets.Shell;
import org.hamcrest.Matcher;
import org.jboss.reddeer.common.logging.Logger;
import org.jboss.reddeer.swt.lookup.ShellLookup;
import org.jboss.reddeer.swt.matcher.WithTextMatcher;
import org.jboss.reddeer.swt.util.internal.InstanceValidator;

/**
 * Condition is met when shell with specific text (title) is available.
 * 
 * @author <NAME> (<EMAIL>)
 * @author jniederm
 */
public class ShellWithTextIsAvailable implements WaitCondition { 
	private Matcher<String> matcher;
	private final Logger log = Logger.getLogger(this.getClass());

	/**
	 * Constructs ShellWithTextIsAvailable wait condition.
	 * Condition is met when shell with the specified title is available.
	 * 
	 * @param text text/name of the shell
	 */
	public ShellWithTextIsAvailable(String title) {
		InstanceValidator.checkNotNull(title, "title");
		this.matcher = new WithTextMatcher(title);
	}

	@Override
	public boolean test() {
		log.debug("Looking for shell with title matching '" + matcher + "'");
		Shell shell = ShellLookup.getInstance().getShell(matcher);
		return shell != null;
	}

	@Override
	public String description() {
		return "shell with title matching " + matcher + " is available";
	}
}
{'fraction_non_alphanumeric': 0.1111531190926276, 'fraction_numerical': 0.0011342155009451795, 'mean_word_length': 4.714902807775378, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4560556', 'n_tokens_mistral': 843, 'n_tokens_neox': 791, 'n_words': 212}