<commit_before>package io.github.data4all.model.map;

import io.github.data4all.R;
import io.github.data4all.activity.AbstractMapActivity;
import org.osmdroid.bonuspack.overlays.Polyline;
import org.osmdroid.views.MapView;

import android.app.AlertDialog;
import android.content.DialogInterface;
import android.view.MotionEvent;

/**
 * With LongClick deletable Polyline.
 * 
 * @author <NAME>
 *
 */
class MapLine extends Polyline implements DialogInterface.OnClickListener {

    AbstractMapActivity mapActivity;

    /**
     * Default constructor.
     * 
     * @param ctx
     *            the Context for the Overlay
     */
    public MapLine(AbstractMapActivity ctx) {
        super(ctx);

    }

    @Override
    public boolean onLongPress(final MotionEvent e, final MapView mapView) {
        final AlertDialog.Builder builder = new AlertDialog.Builder(
                mapView.getContext());
        builder.setMessage(mapActivity.getString(R.string.deleteDialog))
                .setPositiveButton(mapActivity.getString(R.string.yes), this)
                .setNegativeButton(mapActivity.getString(R.string.no), this)
                .show();

        return true;

    }

    @Override
    public void onClick(DialogInterface dialog, int which) {
        switch (which) {
        case DialogInterface.BUTTON_POSITIVE:<commit_msg>fixes SonarQube Issues<commit_after>package io.github.data4all.model.map;

import io.github.data4all.R;
import io.github.data4all.activity.AbstractMapActivity;
import org.osmdroid.bonuspack.overlays.Polyline;
import org.osmdroid.views.MapView;

import android.app.AlertDialog;
import android.content.DialogInterface;
import android.view.MotionEvent;

/**
 * With LongClick deletable Polyline.
 * 
 * @author <NAME>
 *
 */
public class MapLine extends Polyline implements DialogInterface.OnClickListener {

    AbstractMapActivity mapActivity;

    /**
     * Default constructor.
     * 
     * @param ctx
     *            the Context for the Overlay
     */
    public MapLine(AbstractMapActivity ctx) {
        super(ctx);
        mapActivity = ctx;

    }

    @Override
    public boolean onLongPress(final MotionEvent e, final MapView mapView) {
        final AlertDialog.Builder builder = new AlertDialog.Builder(
                mapView.getContext());
        builder.setMessage(mapActivity.getString(R.string.deleteDialog))
                .setPositiveButton(mapActivity.getString(R.string.yes), this)
                .setNegativeButton(mapActivity.getString(R.string.no), this)
                .show();

        return true;

    }

    @Override
    public void onClick(DialogInterface dialog, int which) {
        switch (which) {
        case DialogInterface.BUTTON_POSITIVE:
{'fraction_non_alphanumeric': 0.09220636663007684, 'fraction_numerical': 0.0021953896816684962, 'mean_word_length': 2.878014184397163, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4329230', 'n_tokens_mistral': 784, 'n_tokens_neox': 746, 'n_words': 158}