If you added this to the CoreConfig object in JGit, you can instead do:

  repository.getConfig().get(CoreConfig.KEY).getFileMode()

and have it use a cached CoreConfig instance, which itself has cached the value of core.filemode.  Doing this allows the cached value to be evicted and rebuilt when any property in the configuration file changes, or if the underlying config file on disk is modified.  That makes EGit more responsive to updates.

Also, isn't:

  Boolean.valueOf(exprOfTypePrimitiveBoolean).booleanValue())

Kind of pointless?  You are casting boolean to Boolean, and then casting back.  Uh.  WTF?