<commit_before>package de.lessvoid.xml.tools;

import java.lang.reflect.Method;

/**
 * MethodResolver helper class.
 * @author void
 */
public class MethodResolver {
  /**
   * you can't instantiate this class it's a helper class.
   */
  private MethodResolver() {
  }

  /**
   * find a method per name in the given class.
   * @param c the class to look for
   * @param methodName the methodName
   * @return the Method instance
   */
  public static Method findMethod(final Class < ? > c, final String methodName) {
    if (c == null) {
      return null;
    }

    String methodNameOnly = methodName.substring(0, methodName.indexOf('('));

    Method[] ms = c.getDeclaredMethods();
    for (Method m : ms) {
      if (methodNameOnly.equalsIgnoreCase(m.getName())) {
        return m;
      }
    }
<commit_msg>use getMethods() instead of getDeclaredMethods() to only access the public methods which should improve compatibility with java applets<commit_after>package de.lessvoid.xml.tools;

import java.lang.reflect.Method;

/**
 * MethodResolver helper class.
 * @author void
 */
public class MethodResolver {
  /**
   * you can't instantiate this class it's a helper class.
   */
  private MethodResolver() {
  }

  /**
   * find a method per name in the given class.
   * @param c the class to look for
   * @param methodName the methodName
   * @return the Method instance
   */
  public static Method findMethod(final Class < ? > c, final String methodName) {
    if (c == null) {
      return null;
    }

    String methodNameOnly = methodName.substring(0, methodName.indexOf('('));

    Method[] ms = c.getMethods();
    for (Method m : ms) {
      if (methodNameOnly.equalsIgnoreCase(m.getName())) {
        return m;
      }
    }

{'fraction_non_alphanumeric': 0.11212814645308924, 'fraction_numerical': 0.0011441647597254005, 'mean_word_length': 2.904017857142857, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '2492348', 'n_tokens_mistral': 521, 'n_tokens_neox': 508, 'n_words': 169}