<commit_before>package brooklyn.web.console.entity


import brooklyn.entity.Entity


public class JsTreeNodeImpl implements JsTreeNode {

    private String id;
    private Map<String, String> data = [:]
    private List<JsTreeNode> children = []
    public transient boolean matched;

    public JsTreeNodeImpl(Entity e, Boolean matched=false) {
        this(e.id, e.displayName, e.entityClass?.name ?: "$e [no entity class]", matched)
    }

    public JsTreeNodeImpl(String id, String name, String clazz, Boolean matched) {
        this.id = id;
        this.data.put("title", name)
        this.data.put("type", clazz)
        this.matched = matched
    }

    public String getId() {
        return id
    }

    public String getState() {
        if (children) {
            return matched ? "open" : "closed"
        } else {
            return "leaf"
        }
    }<commit_msg>Fixing problem with ? and ?: operator precedence<commit_after>package brooklyn.web.console.entity


import brooklyn.entity.Entity


public class JsTreeNodeImpl implements JsTreeNode {

    private String id;
    private Map<String, String> data = [:]
    private List<JsTreeNode> children = []
    public transient boolean matched;

    public JsTreeNodeImpl(Entity e, Boolean matched=false) {
        this(e.id, e.displayName, (e.entityClass?.name) ?: "$e [no entity class]", matched)
    }

    public JsTreeNodeImpl(String id, String name, String clazz, Boolean matched) {
        this.id = id;
        this.data.put("title", name)
        this.data.put("type", clazz)
        this.matched = matched
    }

    public String getId() {
        return id
    }

    public String getState() {
        if (children) {
            return matched ? "open" : "closed"
        } else {
            return "leaf"
        }
    }
{'fraction_non_alphanumeric': 0.10668877833056938, 'fraction_numerical': 0.0, 'mean_word_length': 2.44106463878327, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '4362999', 'n_tokens_mistral': 545, 'n_tokens_neox': 524, 'n_words': 145}