<commit_before>//
// $Id$

package com.threerings.gwt.util;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.Command;

/**
 * {@link Command} related utility methods.
 */
public class Commands
{
    /**
     * Returns a {@link ClickHandler} that executes the supplied command when triggered.
     */
    public static ClickHandler onClick (final Command onClick)
    {
        return new ClickHandler() {
            public void onClick (ClickEvent event) {
                onClick.execute();
            }
        };
    }
}<commit_msg>If we're passed a null command, return a null handler.<commit_after>//
// $Id$

package com.threerings.gwt.util;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.Command;

/**
 * {@link Command} related utility methods.
 */
public class Commands
{
    /**
     * Returns a {@link ClickHandler} that executes the supplied command when triggered.
     */
    public static ClickHandler onClick (final Command onClick)
    {
        return (onClick == null) ? null : new ClickHandler() {
            public void onClick (ClickEvent event) {
                onClick.execute();
            }
        };
    }
}
{'fraction_non_alphanumeric': 0.1157337367624811, 'fraction_numerical': 0.0, 'mean_word_length': 2.5660377358490565, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7581228', 'n_tokens_mistral': 382, 'n_tokens_neox': 377, 'n_words': 102}