]> source.dussan.org Git - jgit.git/commit
Return a new instance from openSystemConfig and openUserConfig 73/148373/4
authorMatthias Sohn <matthias.sohn@sap.com>
Mon, 26 Aug 2019 20:43:11 +0000 (22:43 +0200)
committerMatthias Sohn <matthias.sohn@sap.com>
Fri, 30 Aug 2019 00:34:13 +0000 (02:34 +0200)
commitaf0296b42c150cf2191e2279cb50cfec8ff8a270
treefe4c67caf170c69eac2282a148424c0327b057da
parent418722df34ca007362e23be60ef57dbe6f1d1b7a
Return a new instance from openSystemConfig and openUserConfig

Move the handling of cached user and system config to getSystemConfig
and getUserConfig methods and revert the implementation of
openSystemConfig and openUserConfig to the old stateless
implementation.

This ensures the open methods respect the passed-in parent config, which
may be different on each invocation. Additionally, returning a new
instance matches the behavior of the previous implementation of the
default system reader, which downstream callers may be depending on.

Move the implementation of the new caching methods getSystemConfig and
getUserConfig up to SystemReader. This avoids that we break the ABI for
subclasses of SystemReader.

Also see [1] which fixed a similar problem with Gerrit's custom
SystemReader.

[1] https://gerrit-review.googlesource.com/c/gerrit/+/225458

Change-Id: If54a2491932d8fc914d4649cb73c9e837c5b8ad0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
org.eclipse.jgit.test/META-INF/MANIFEST.MF
org.eclipse.jgit.test/tst/org/eclipse/jgit/util/SystemReaderTest.java [new file with mode: 0644]
org.eclipse.jgit/.settings/.api_filters
org.eclipse.jgit/src/org/eclipse/jgit/util/SystemReader.java