private static LocalInspectionEP findInspectionEP(@NotNull LocalInspectionTool tool) {
    LocalInspectionEP byKey = LocalInspectionEP.LOCAL_INSPECTION.getByKey(tool.getShortName(), LocalInspectionToolWrapper.class, InspectionEP::getShortName);
    if (byKey != null) {
      return byKey;
    }
    // sometimes tool.getShortName() is inconsistent with `shortName="xxx"` in plugin.xml. For example: CheckDtdReferencesInspection
    // revert to brute force search among all extensions in this case
    return LocalInspectionEP.LOCAL_INSPECTION.findFirstSafe(ep -> tool.getClass().getName().equals(ep.implementationClass));
  }
private static LocalInspectionEP findInspectionEP(@NotNull LocalInspectionTool tool)