+/*
+ * Copyright 2021 gitblit.com, Ingo Lafrenz
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package com.gitblit;
import java.io.File;
import java.util.Objects;
import java.util.SortedMap;
import java.util.TreeMap;
-import java.util.function.Function;
/**
* Simple class with the only purpose to save the realm file (users.conf) in
}
public void setString(final String section, final String subsection, String name, String value) {
- Section s = sections.computeIfAbsent(generateKey(section, subsection), new Function<String, Section>() {
- @Override
- public Section apply(String k) {
- return new Section(section, subsection);
- }
- });
+ String key = generateKey(section, subsection);
+ Section s = sections.get(key);
+ if (s == null) {
+ s = new Section(section, subsection);
+ sections.put(key, s);
+ }
s.addEntry(name, value);
}