<commit_before>package org.openqa.selenium.internal;

import org.json.JSONArray;
import org.json.JSONException;
import org.openqa.selenium.Ignore;
import org.openqa.selenium.remote.BeanToJsonConverter;

import java.lang.reflect.Method;
import java.util.*;

public class IgnoreCollector implements IgnoredTestCallback {
  private Set<Map> tests = new HashSet<Map>();
  private BeanToJsonConverter converter = new BeanToJsonConverter();

  public void callback(Class clazz, String testName, Ignore ignore) {
    for (String name : getTestMethodsFor(clazz, testName)) {
      tests.add(IgnoredTestCase.asMap(clazz.getName(), name, ignore));
    }
  }

  private List<String> getTestMethodsFor(Class clazz, String testName) {
    if (!testName.isEmpty()) {
      return Arrays.asList(testName);
    }

    List<String> testMethods = new ArrayList<String>();

    Method[] methods = clazz.getDeclaredMethods();
    for (Method method : methods) {
      if (isTestMethod(method)) {
        testMethods.add(method.getName());
      }
    }
    return testMethods;
  }

  private boolean isTestMethod(Method method) {
    return method.getAnnotation(org.junit.Test.class) != null || method.getName().startsWith("test");
  }

  public String toJson() throws JSONException {
    return new JSONArray(converter.convert(tests)).toString();
  }

  private static class IgnoredTestCase {
    public static Map<String, Object> asMap(String className, String testName, Ignore ignore) {
      final Map<String, Object> map = new HashMap<String, Object>();
      map.put("className", className);
      map.put("testName", testName);
      map.put("reason", ignore.reason());

      final Set<String> drivers = new HashSet<String>();
      for (Ignore.Driver driver : ignore.value()) {
        drivers.add(driver.name());
      }

      map.put("drivers", drivers);

      return map;
    }
  }
}<commit_msg>JariBakken: Dump Ignore.issues() as well.<commit_after>package org.openqa.selenium.internal;

import org.json.JSONArray;
import org.json.JSONException;
import org.openqa.selenium.Ignore;
import org.openqa.selenium.remote.BeanToJsonConverter;

import java.lang.reflect.Method;
import java.util.*;

public class IgnoreCollector implements IgnoredTestCallback {
  private Set<Map> tests = new HashSet<Map>();
  private BeanToJsonConverter converter = new BeanToJsonConverter();

  public void callback(Class clazz, String testName, Ignore ignore) {
    for (String name : getTestMethodsFor(clazz, testName)) {
      tests.add(IgnoredTestCase.asMap(clazz.getName(), name, ignore));
    }
  }

  private List<String> getTestMethodsFor(Class clazz, String testName) {
    if (!testName.isEmpty()) {
      return Arrays.asList(testName);
    }

    List<String> testMethods = new ArrayList<String>();

    Method[] methods = clazz.getDeclaredMethods();
    for (Method method : methods) {
      if (isTestMethod(method)) {
        testMethods.add(method.getName());
      }
    }
    return testMethods;
  }

  private boolean isTestMethod(Method method) {
    return method.getAnnotation(org.junit.Test.class) != null || method.getName().startsWith("test");
  }

  public String toJson() throws JSONException {
    return new JSONArray(converter.convert(tests)).toString();
  }

  private static class IgnoredTestCase {
    public static Map<String, Object> asMap(String className, String testName, Ignore ignore) {
      final Map<String, Object> map = new HashMap<String, Object>();
      map.put("className", className);
      map.put("testName", testName);
      map.put("reason", ignore.reason());
      map.put("issues", ignore.issues());

      final Set<String> drivers = new HashSet<String>();
      for (Ignore.Driver driver : ignore.value()) {
        drivers.add(driver.name());
      }

      map.put("drivers", drivers);

      return map;
    }
  }
}
{'fraction_non_alphanumeric': 0.12655925155925155, 'fraction_numerical': 0.0, 'mean_word_length': 3.841509433962264, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, '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': '937915', 'n_tokens_mistral': 1141, 'n_tokens_neox': 1109, 'n_words': 262}