def getRef()

in scala-repl/src/main/scala/org/jetbrains/ztools/scala/reference/ReferenceManager.scala [19:35]


  def getRef(obj: Any, path: String): String = obj match {
    case null | _: Unit =>
      clearRefIfPathExists(path)
      null
    case ref: AnyRef =>
      val wrapper = new ReferenceWrapper(ref)
      if (refMap.contains(wrapper)) {
        if (refInvMap.get(path).orNull != wrapper) clearRefIfPathExists(path)
        refMap(wrapper)
      } else {
        clearRefIfPathExists(path)
        refMap(wrapper) = path
        refInvMap.put(path, wrapper)
        null
      }
    case _ => null
  }