<commit_before>package com.arondor.common.reflection.gwt.client.view.fields;

import com.arondor.common.reflection.gwt.client.presenter.fields.MapTreeNodePresenter;
import com.arondor.common.reflection.gwt.client.presenter.fields.MapTreeNodePresenter.MapNodeDisplay;
import com.arondor.common.reflection.gwt.client.view.AbstractTreeNodeView;
import com.arondor.common.reflection.gwt.client.view.resources.Images;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.Style.Cursor;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.user.client.ui.HasVisibility;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.UIObject;

public class MapRootView extends AbstractTreeNodeView implements MapTreeNodePresenter.MapRootDisplay
{
    private static final Images IMAGES = GWT.create(Images.class);

    private HasClickHandlers addElement;

    public MapRootView(UIObject parentNode)
    {
        super(parentNode);
        Image addButton = new Image(IMAGES.add16());
        addButton.getElement().getStyle().setCursor(Cursor.POINTER);
        addButton.getElement().getStyle().setMarginLeft(5, Unit.PX);
        getContents().add(addButton);
        addElement = addButton;
        setHasRemoveButton(true);
    }

    public void clear()
    {
        removeItems();
    }

    public HasClickHandlers addElementClickHandler()
    {
        return addElement;
    }

    public MapNodeDisplay createChildNode()
    {
        setActive(true);
        MapNodeDisplay mapNodeDisplay = new MapNodeView(this);

        /**
         * Enforce element visibility
         */
        if (mapNodeDisplay instanceof HasVisibility)
        {
            ((HasVisibility) mapNodeDisplay).setVisible(true);
        }
        return mapNodeDisplay;
    }
}<commit_msg>CodeCleanup : Remove useless cast by removing early interface casting<commit_after>package com.arondor.common.reflection.gwt.client.view.fields;

import com.arondor.common.reflection.gwt.client.presenter.fields.MapTreeNodePresenter;
import com.arondor.common.reflection.gwt.client.presenter.fields.MapTreeNodePresenter.MapNodeDisplay;
import com.arondor.common.reflection.gwt.client.view.AbstractTreeNodeView;
import com.arondor.common.reflection.gwt.client.view.resources.Images;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.Style.Cursor;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.UIObject;

public class MapRootView extends AbstractTreeNodeView implements MapTreeNodePresenter.MapRootDisplay
{
    private static final Images IMAGES = GWT.create(Images.class);

    private HasClickHandlers addElement;

    public MapRootView(UIObject parentNode)
    {
        super(parentNode);
        Image addButton = new Image(IMAGES.add16());
        addButton.getElement().getStyle().setCursor(Cursor.POINTER);
        addButton.getElement().getStyle().setMarginLeft(5, Unit.PX);
        getContents().add(addButton);
        addElement = addButton;
        setHasRemoveButton(true);
    }

    public void clear()
    {
        removeItems();
    }

    public HasClickHandlers addElementClickHandler()
    {
        return addElement;
    }

    public MapNodeDisplay createChildNode()
    {
        setActive(true);
        MapNodeView mapNodeDisplay = new MapNodeView(this);

        /**
         * Enforce element visibility
         */
        mapNodeDisplay.setVisible(true);
        return mapNodeDisplay;
    }
}
{'fraction_non_alphanumeric': 0.10273224043715846, 'fraction_numerical': 0.001639344262295082, 'mean_word_length': 3.5478260869565217, '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': '686055', 'n_tokens_mistral': 1097, 'n_tokens_neox': 1085, 'n_words': 167}