private def invokeMethodIfExists[R : ClassTag]()

in extractor/src/main/scala/org/jetbrains/sbt/extractors/ProjectExtractor.scala [282:287]


  private def invokeMethodIfExists[R : ClassTag](obj: AnyRef, methodName: String): Option[R] =
    Try(obj.getClass.getMethod(methodName)) match {
      case Success(method)                   => Some(method.invoke(obj).asInstanceOf[R])
      case Failure(_: NoSuchMethodException) => None
      case Failure(ex)                       => throw ex
    }