Github user jvz commented on a diff in the pull request:
https://github.com/apache/logging-log4j2/pull/87#discussion_r124592044
--- Diff:
log4j-core/src/main/java/org/apache/logging/log4j/core/appender/ThreadHints.java
---
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 org.apache.logging.log4j.core.appender;
+
+/**
+ * This class captures possible performance hints that may be used by some
+ * runtimes to improve code performance. It is intended to capture hinting
+ * behaviors that are implemented in or anticipated to be spec'ed under the
+ * java.lang.Thread class in some Java SE versions, but missing in prior
+ * versions.
+ *
+ * Written by Gil Tene, and released to the public domain,
+ * as explained at http://creativecommons.org/publicdomain/zero/1.0/
+ */
+final class ThreadHints {
+
+ private static final boolean okToInvokeThreadHintsMHCaller;
+
+ static {
+ boolean okToInvokeMHCaller;
+
+ try {
+ Class.forName("java.lang.invoke.MethodHandle");
--- End diff --
Two things here:
1. We have a LoaderUtil class for loading classes which tends to work a bit
better than using `Class.forName`.
2. We're on Java 7 minimum, so this class is for sure available. No need
for reflection here.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---