Save server log settings without Stream.toList
Stream.toList() is API 34; on Android 13 every settings save crashed with NoSuchMethodError once the server log settings were stored. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -8,6 +8,7 @@ import java.util.List;
|
|||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* How the Server Log window shows the log: which levels, in which time zone, which lines
|
* How the Server Log window shows the log: which levels, in which time zone, which lines
|
||||||
@@ -96,7 +97,7 @@ public final class ServerLogSettings {
|
|||||||
p.stringPropertyNames().stream()
|
p.stringPropertyNames().stream()
|
||||||
.filter(k -> k.startsWith(PREFIX + "highlight.") || k.startsWith(PREFIX + "exclude."))
|
.filter(k -> k.startsWith(PREFIX + "highlight.") || k.startsWith(PREFIX + "exclude."))
|
||||||
.forEach(p::remove);
|
.forEach(p::remove);
|
||||||
p.setProperty(PREFIX + "levels", String.join(",", levels.stream().map(Enum::name).toList()));
|
p.setProperty(PREFIX + "levels", levels.stream().map(Enum::name).collect(Collectors.joining(",")));
|
||||||
p.setProperty(PREFIX + "localTime", Boolean.toString(localTime));
|
p.setProperty(PREFIX + "localTime", Boolean.toString(localTime));
|
||||||
p.setProperty(PREFIX + "highlights", Integer.toString(highlights.size()));
|
p.setProperty(PREFIX + "highlights", Integer.toString(highlights.size()));
|
||||||
for (int i = 0; i < highlights.size(); i++) {
|
for (int i = 0; i < highlights.size(); i++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user