package zielu.intellij.util

import java.util.ResourceBundle

class ZBundleHolder(private val bundleName: String) {
  private var bundle: ResourceBundle? = null

  fun getBundle(): ResourceBundle {
    if (bundle == null) {
      bundle = ResourceBundle.getBundle(bundleName)
    }
    return checkNotNull(bundle) { "Failed to load resource bundle $bundleName" }
  }
}

package zielu.intellij.util

import java.util.ResourceBundle

class ZBundleHolder(private val bundleName: String) {
  val bundle: ResourceBundle by lazy {
    ResourceBundle.getBundle(bundleName)
  }
}

Use lazy instead of custom loading
Use lazy instead of custom loading

zielu/GitToolBox,zielu/GitToolBox,zielu/GitToolBox