This is an automated email from the ASF dual-hosted git repository. sankarh pushed a commit to branch branch-3 in repository https://gitbox.apache.org/repos/asf/hive.git
The following commit(s) were added to refs/heads/branch-3 by this push: new 8fa292d4892 HIVE-27610: Backport of HIVE-22161: UDF: FunctionRegistry synchronizes on org.apache.hadoop.hive.ql.udf.UDFType class (Gopal V, reviewed by Ashutosh Chauhan) 8fa292d4892 is described below commit 8fa292d4892a3daf3403c1072d8a8ef5b73892eb Author: Aman Raj <104416558+amanraj2...@users.noreply.github.com> AuthorDate: Mon Aug 28 13:59:46 2023 +0530 HIVE-27610: Backport of HIVE-22161: UDF: FunctionRegistry synchronizes on org.apache.hadoop.hive.ql.udf.UDFType class (Gopal V, reviewed by Ashutosh Chauhan) Signed-off-by: Sankar Hariappan <sank...@apache.org> Closes (#4589) --- .../java/org/apache/hive/common/util/AnnotationUtils.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/common/src/java/org/apache/hive/common/util/AnnotationUtils.java b/common/src/java/org/apache/hive/common/util/AnnotationUtils.java index a73faca4a25..bfbaea69fc7 100644 --- a/common/src/java/org/apache/hive/common/util/AnnotationUtils.java +++ b/common/src/java/org/apache/hive/common/util/AnnotationUtils.java @@ -23,17 +23,15 @@ import java.lang.reflect.Method; public class AnnotationUtils { - // to avoid https://bugs.openjdk.java.net/browse/JDK-7122142 + // until JDK8, this had a lock around annotationClass to avoid + // https://bugs.openjdk.java.net/browse/JDK-7122142 public static <T extends Annotation> T getAnnotation(Class<?> clazz, Class<T> annotationClass) { - synchronized (annotationClass) { - return clazz.getAnnotation(annotationClass); - } + return clazz.getAnnotation(annotationClass); } - // to avoid https://bugs.openjdk.java.net/browse/JDK-7122142 + // until JDK8, this had a lock around annotationClass to avoid + // https://bugs.openjdk.java.net/browse/JDK-7122142 public static <T extends Annotation> T getAnnotation(Method method, Class<T> annotationClass) { - synchronized (annotationClass) { - return method.getAnnotation(annotationClass); - } + return method.getAnnotation(annotationClass); } }