Fix log message about using non-direct buffers by default (#8235)

Motivation:

f77891cc17 changed slightly how we detect if we should prefer direct buffers or not but did miss to also take this into account when logging.

Modifications:

Fix branch for log message to reflect changes in f77891cc17.

Result:

Correct logging.
This commit is contained in:
Norman Maurer 2018-08-30 06:57:12 +02:00 committed by GitHub
parent b73f785631
commit 4a5b61fc13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -128,17 +128,6 @@ public final class PlatformDependent {
}; };
} }
/*
* We do not want to log this message if unsafe is explicitly disabled. Do not remove the explicit no unsafe
* guard.
*/
if (!hasUnsafe() && !isAndroid() && !PlatformDependent0.isExplicitNoUnsafe()) {
logger.info(
"Your platform does not provide complete low-level API for accessing direct buffers reliably. " +
"Unless explicitly requested, heap buffer will always be preferred to avoid potential system " +
"instability.");
}
// Here is how the system property is used: // Here is how the system property is used:
// //
// * < 0 - Don't use cleaner, and inherit max direct memory from java. In this case the // * < 0 - Don't use cleaner, and inherit max direct memory from java. In this case the
@ -193,6 +182,17 @@ public final class PlatformDependent {
if (logger.isDebugEnabled()) { if (logger.isDebugEnabled()) {
logger.debug("-Dio.netty.noPreferDirect: {}", !DIRECT_BUFFER_PREFERRED); logger.debug("-Dio.netty.noPreferDirect: {}", !DIRECT_BUFFER_PREFERRED);
} }
/*
* We do not want to log this message if unsafe is explicitly disabled. Do not remove the explicit no unsafe
* guard.
*/
if (CLEANER == NOOP && !PlatformDependent0.isExplicitNoUnsafe()) {
logger.info(
"Your platform does not provide complete low-level API for accessing direct buffers reliably. " +
"Unless explicitly requested, heap buffer will always be preferred to avoid potential system " +
"instability.");
}
} }
public static boolean hasDirectBufferNoCleanerConstructor() { public static boolean hasDirectBufferNoCleanerConstructor() {