private int instrumentNotNull(File dir, final InstrumentationClassFinder finder) {
    int instrumented = 0;

    File[] files = dir.listFiles();
    if (files == null) return 0;
    for (File file : files) {
      final String name = file.getName();
      if (name.endsWith(".class")) {
        final String path = file.getPath();
        log("Adding @NotNull assertions to " + path, Project.MSG_VERBOSE);
        try {
          try (FileInputStream inputStream = new FileInputStream(file)) {
            ClassReader reader = new FailSafeClassReader(inputStream);

            int version = InstrumenterClassWriter.getClassFileVersion(reader);

            if ((version & 0xFFFF) >= Opcodes.V1_5 && !shouldBeSkippedByAnnotationPattern(reader)) {
              ClassWriter writer = new InstrumenterClassWriter(reader, InstrumenterClassWriter.getAsmClassWriterFlags(version), finder);

              if (NotNullVerifyingInstrumenter.processClassFile(reader, writer, getNotNullAnnotations().split(";"))) {
                try (FileOutputStream fileOutputStream = new FileOutputStream(path)) {
                  fileOutputStream.write(writer.toByteArray());
                  instrumented++;
                }
              }
            }
          }
        }
        catch (IOException e) {
          log("Failed to instrument @NotNull assertion for " + path + ": " + e.getMessage(), Project.MSG_WARN);
        }
        catch (Exception e) {
          fireError("@NotNull instrumentation failed for " + path + ": " + e);
        }
      }
      else if (file.isDirectory()) {
        instrumented += instrumentNotNull(file, finder);
      }
    }

    return instrumented;
  }
private int instrumentNotNull(File dir, final InstrumentationClassFinder finder)