Default to using channel metadata

This commit is contained in:
fullwall 2022-12-04 03:24:57 +08:00
parent 06230800b9
commit a74e40eb1d

View File

@ -345,7 +345,7 @@ public class Util {
version = Version.identify().get("netty-all"); version = Version.identify().get("netty-all");
} }
if (version == null) if (version == null)
return REQUIRES_CHANNEL_METADATA = false; return REQUIRES_CHANNEL_METADATA = true;
try { try {
Integer[] parts = StreamSupport Integer[] parts = StreamSupport
.stream(Splitter.on('.').split(version.artifactVersion()).spliterator(), false).map(string -> { .stream(Splitter.on('.').split(version.artifactVersion()).spliterator(), false).map(string -> {
@ -359,7 +359,7 @@ public class Util {
int major = parts[0]; int major = parts[0];
int minor = parts[1]; int minor = parts[1];
int patch = parts[2]; int patch = parts[2];
return REQUIRES_CHANNEL_METADATA = major >= 5 || major == 4 && (minor > 1 || patch >= 1); return REQUIRES_CHANNEL_METADATA = major >= 5 || major == 4 && (minor > 1 || patch >= 25);
} catch (Throwable t) { } catch (Throwable t) {
t.printStackTrace(); t.printStackTrace();
return REQUIRES_CHANNEL_METADATA = true; return REQUIRES_CHANNEL_METADATA = true;