<commit_before>package view_inspector.util;

import android.support.v7.internal.widget.ActionBarOverlayLayout;
import android.util.Log;
import android.view.View;
import android.view.ViewParent;
import view_inspector.ViewInspector;

public final class ViewUtil {

  public static String getViewId(View view) {
    return view.getId() > 0 ? view.getResources().getResourceName(view.getId()) : "";
  }

  public static String getSimpleViewId(View view) {
    String viewId = getViewId(view);
    if (viewId.length() > 0 && !viewId.startsWith("android")) viewId = viewId.split(":")[1];
    return viewId;
  }<commit_msg>Handle resource name not found exception<commit_after>package view_inspector.util;

import android.content.res.Resources;
import android.support.v7.internal.widget.ActionBarOverlayLayout;
import android.util.Log;
import android.view.View;
import android.view.ViewParent;
import view_inspector.ViewInspector;

public final class ViewUtil {

  public static String getViewId(View view) {
    try {
      return view.getId() > 0 ? view.getResources().getResourceName(view.getId()) : "";
    } catch (Resources.NotFoundException e) {
      return "";
    }
  }

  public static String getSimpleViewId(View view) {
    String viewId = getViewId(view);
    if (viewId.length() > 0 && !viewId.startsWith("android")) viewId = viewId.split(":")[1];
    return viewId;
  }
{'fraction_non_alphanumeric': 0.12336719883889695, 'fraction_numerical': 0.005805515239477504, 'mean_word_length': 4.651639344262295, 'pattern_counts': {'":': 2, '<': 3, '<?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': '1117286', 'n_tokens_mistral': 429, 'n_tokens_neox': 423, 'n_words': 94}