<commit_before>package com.benoitquenaudon.tvfoot.red.app.common.notification;

import android.app.AlarmManager;
import android.app.Application;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import com.benoitquenaudon.tvfoot.red.app.common.StreamNotification;
import com.benoitquenaudon.tvfoot.red.app.data.entity.Match;
import com.benoitquenaudon.tvfoot.red.app.domain.match.job.MatchReminderService;
import io.reactivex.Single;
import javax.inject.Inject;

import static android.text.format.DateUtils.MINUTE_IN_MILLIS;
import static com.benoitquenaudon.tvfoot.red.app.domain.match.job.MatchReminderService.ACTION_PUBLISH_NOTIFICATION;

public class NotificationService {
  private final Context context;
  private final AlarmManager alarmManager;

  @Inject public NotificationService(Application context, AlarmManager alarmManager) {
    this.context = context;
    this.alarmManager = alarmManager;
  }

  public Single<StreamNotification> scheduleNotification(String matchId, long startAt,
      boolean shouldNotify) {
    Intent intent = new Intent(context, MatchReminderService.class) //
        .setAction(ACTION_PUBLISH_NOTIFICATION) //
        .putExtra(Match.MATCH_ID, matchId);

    PendingIntent serviceIntent = PendingIntent.getService(context, matchIdAsInt(matchId), intent,
        PendingIntent.FLAG_CANCEL_CURRENT);

    if (shouldNotify) {
      alarmManager.setExact(AlarmManager.RTC_WAKEUP, startAt - 10 * MINUTE_IN_MILLIS,
          serviceIntent);
    } else {
      alarmManager.cancel(serviceIntent);
    }

    return Single.just(StreamNotification.INSTANCE);
  }

  static int matchIdAsInt(String matchId) {
    //return Integer.parseInt(matchId(), 16);
    return Integer.parseInt(matchId.replaceAll("[^0-9]", "").substring(1, 10));
  }
}
<commit_msg>we don't play around here<commit_after>package com.benoitquenaudon.tvfoot.red.app.common.notification;

import android.app.AlarmManager;
import android.app.Application;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import com.benoitquenaudon.tvfoot.red.app.common.StreamNotification;
import com.benoitquenaudon.tvfoot.red.app.data.entity.Match;
import com.benoitquenaudon.tvfoot.red.app.domain.match.job.MatchReminderService;
import io.reactivex.Single;
import java.util.concurrent.TimeUnit;
import javax.inject.Inject;

import static com.benoitquenaudon.tvfoot.red.app.domain.match.job.MatchReminderService.ACTION_PUBLISH_NOTIFICATION;

public class NotificationService {
  private final Context context;
  private final AlarmManager alarmManager;

  @Inject public NotificationService(Application context, AlarmManager alarmManager) {
    this.context = context;
    this.alarmManager = alarmManager;
  }

  public Single<StreamNotification> scheduleNotification(String matchId, long startAt,
      boolean shouldNotify) {
    Intent intent = new Intent(context, MatchReminderService.class) //
        .setAction(ACTION_PUBLISH_NOTIFICATION) //
        .putExtra(Match.MATCH_ID, matchId);

    PendingIntent serviceIntent = PendingIntent.getService(context, matchIdAsInt(matchId), intent,
        PendingIntent.FLAG_CANCEL_CURRENT);

    if (shouldNotify) {
      alarmManager.setExact(AlarmManager.RTC_WAKEUP, startAt - TimeUnit.MINUTES.toMillis(10),
          serviceIntent);
    } else {
      alarmManager.cancel(serviceIntent);
    }

    return Single.just(StreamNotification.INSTANCE);
  }

  static int matchIdAsInt(String matchId) {
    //return Integer.parseInt(matchId(), 16);
    return Integer.parseInt(matchId.replaceAll("[^0-9]", "").substring(1, 10));
  }
}

{'fraction_non_alphanumeric': 0.0992345544013122, 'fraction_numerical': 0.004920721705850191, 'mean_word_length': 4.892109500805153, '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': '145543', 'n_tokens_mistral': 1139, 'n_tokens_neox': 1103, 'n_words': 188}