Munoon commented on code in PR #1553:
URL: https://github.com/apache/incubator-fury/pull/1553#discussion_r1578377457


##########
java/fury-core/src/main/java/org/apache/fury/reflect/Types.java:
##########
@@ -0,0 +1,362 @@
+/*
+ * 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.fury.reflect;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.AnnotatedType;
+import java.lang.reflect.Array;
+import java.lang.reflect.GenericArrayType;
+import java.lang.reflect.GenericDeclaration;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.lang.reflect.TypeVariable;
+import java.lang.reflect.WildcardType;
+import java.util.Arrays;
+import java.util.Objects;
+import javax.annotation.CheckForNull;
+
+class Types {
+  public static Type newArrayType(Type componentType) {
+    if (componentType instanceof WildcardType) {
+      WildcardType wildcard = (WildcardType) componentType;
+      Type[] lowerBounds = wildcard.getLowerBounds();
+      if (lowerBounds.length == 1) {
+        return new WildcardTypeImpl(new Type[] {lowerBounds[0]}, new Type[] 
{Object.class});
+      } else {
+        Type[] upperBounds = wildcard.getUpperBounds();
+        return new WildcardTypeImpl(new Type[0], new Type[] {upperBounds[0]});
+      }
+    }
+    return componentType instanceof Class
+        ? Array.newInstance((Class<?>) componentType, 0).getClass()
+        : new GenericArrayTypeImpl(componentType);
+  }
+
+  public static boolean typeVariablesEquals(TypeVariable<?> a, Object bobj) {

Review Comment:
   It was `bObj` originally, but for some reasons it fails the codestyle 
check.. I wasn't able to fix this and I also didn't find out a better naming. 
Maybe you have a better idea?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@fury.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@fury.apache.org
For additional commands, e-mail: commits-h...@fury.apache.org

Reply via email to