Unwraps the proxy type if javassist or CGLib is used

@param type the class type
@return the unproxied class name
491525
public static String unwrapProxyClassName(Class<?> type)
   {
      String typeName = null;
      if (type != null)
      {
         if (type.getName().contains("$$EnhancerByCGLIB$$"))
         {
            typeName = CGLIB_CLASSNAME_REGEXP.matcher(type.getName()).replaceAll("$1");
         }
         else if (type.getName().contains("_jvst"))
         {
            typeName = JAVASSIST_CLASSNAME_REGEXP.matcher(type.getName()).replaceAll("$1");
         }
         else
         {
            typeName = type.getName();
         }
      }
      return typeName;
   }
149920
@SuppressWarnings ( "unchecked" )
    @Override
    public <T extends SmbSession> T unwrap ( Class<T> type ) {
        if ( type.isAssignableFrom(this.getClass()) ) {
            return (T) this;
        }
        throw new ClassCastException();
    }
495399
public static Class<?> unboxType( Class<?> wrapperType )
    {
        Class<?> c = wrapperMap.get( wrapperType );
        if ( c != null )
            return c;
        throw new InterpreterError(
            "Not a primitive wrapper type: "+wrapperType );
    }
1364218
@Unstable
    public static String serializeType(Type type)
    {
        if (type == null) {
            return null;
        }

        StringBuilder sb = new StringBuilder();
        if (type instanceof ParameterizedType) {
            ParameterizedType parameterizedType = (ParameterizedType) type;

            String rawTypeName = getTypeName(parameterizedType.getRawType());

            if (parameterizedType.getOwnerType() != null) {
                if (parameterizedType.getOwnerType() instanceof Class) {
                    sb.append(((Class<?>) parameterizedType.getOwnerType()).getName());
                } else {
                    sb.append(parameterizedType.getOwnerType().toString());
                }

                sb.append('.');


                if (parameterizedType.getOwnerType() instanceof ParameterizedType) {
                    // Find simple name of nested type by removing the
                    // shared prefix with owner.
                    sb.append(rawTypeName.replace(
                        ((Class<?>) ((ParameterizedType) parameterizedType.getOwnerType()).getRawType())
                            .getName() + '$', ""));
                } else {
                    sb.append(rawTypeName);
                }
            } else {
                sb.append(rawTypeName);
            }

            if (parameterizedType.getActualTypeArguments() != null
                && parameterizedType.getActualTypeArguments().length > 0) {
                sb.append(OPEN_GENERIC);

                boolean first = true;
                for (Type typeArgument : parameterizedType.getActualTypeArguments()) {
                    if (!first) {
                        sb.append(", ");
                    }
                    sb.append(getTypeName(typeArgument));
                    first = false;
                }

                sb.append(CLOSE_GENERIC);
            }
        } else {
            sb.append(getTypeName(type));
        }

        return sb.toString();
    }
420912
public static String toClassName(final String type) {
        switch (type.charAt(0)) {
            case 'V':
                return CLASS_PRIMITIVE_VOID;
            case 'Z':
                return CLASS_PRIMITIVE_BOOLEAN;
            case 'C':
                return CLASS_PRIMITIVE_CHAR;
            case 'B':
                return CLASS_PRIMITIVE_BYTE;
            case 'S':
                return CLASS_PRIMITIVE_SHORT;
            case 'I':
                return CLASS_PRIMITIVE_INT;
            case 'F':
                return CLASS_PRIMITIVE_FLOAT;
            case 'J':
                return CLASS_PRIMITIVE_LONG;
            case 'D':
                return CLASS_PRIMITIVE_DOUBLE;
            case 'L':
                final int typeParamStart = type.indexOf('<');
                final int endIndex = typeParamStart >= 0 ? typeParamStart : type.indexOf(';');
                return type.substring(1, endIndex);
            case '[':
            case '+':
            case '-':
                return toClassName(type.substring(1));
            case 'T':
                // TODO handle type variables
                return CLASS_OBJECT;
            default:
                throw new IllegalArgumentException("Not a type signature: " + type);
        }
    }
873058
@SuppressWarnings("rawtypes")
	public static String unqualifiedClassName(Class type) {
		if (type.isArray()) {
			return unqualifiedClassName(type.getComponentType()) + "Array";
		}
		String name = type.getName();
		return name.substring(name.lastIndexOf('.') + 1);
	}
621840
private String proxyClassName()
  {
    String simpleName = _proxyClass.getSimpleName();
    int p = simpleName.lastIndexOf("__");
    
    if (p > 0) {
      return simpleName.substring(0, p);
    }
    else {
      return simpleName;
    }
  }
963810
public JsTopicControls getJsTopicControlsFromProxyClass(Class<?> proxy) {
		Class<?> realClass = unProxyClassServices.getRealClass(proxy);
		return realClass.getAnnotation(JsTopicControls.class);
	}
823316
public static Class unwrapType(Class pType) {
        if (pType == Boolean.class) {
            return Boolean.TYPE;
        }
        else if (pType == Byte.class) {
            return Byte.TYPE;
        }
        else if (pType == Character.class) {
            return Character.TYPE;
        }
        else if (pType == Double.class) {
            return Double.TYPE;
        }
        else if (pType == Float.class) {
            return Float.TYPE;
        }
        else if (pType == Integer.class) {
            return Integer.TYPE;
        }
        else if (pType == Long.class) {
            return Long.TYPE;
        }
        else if (pType == Short.class) {
            return Short.TYPE;
        }

        throw new IllegalArgumentException("Not a primitive wrapper: " + pType);
    }
672491
public static long sizeOfInstanceWithUnsafe(Class<?> type) {
        while (type != null)
        {
            long size = 0;
            for (Field f : declaredFieldsOf(type))
                size = Math.max(size, unsafe.objectFieldOffset(f) + sizeOf(f));
            if (size > 0)
                return roundTo(size, SPEC.getObjectPadding());
            type = type.getSuperclass();
        }
        return roundTo(SPEC.getObjectHeaderSize(), SPEC.getObjectPadding());
    }
1326611
public <T> Unmarshaller<T, JsonUnmarshallerContext> getUnmarshaller(Class<T> type, UnmarshallerType unmarshallerType) {
        return null;
    }
1247835
public static boolean isProxyClass(Class<?> c) {
        // TODO: use a marker interface instead?
        try {
            c.getDeclaredField(FIELD_NAME_HANDLER);
            return true;
        } catch (NoSuchFieldException e) {
            return false;
        }
    }
1356346
public Optional<MapperInstance> getDeserializer( JType type ) {
        return Optional.fromNullable( deserializers.get( type.getQualifiedSourceName() ) );
    }
391164
public static Class<?> classFromAsmType(Type type) {
    Optional<Class<?>> maybeClass = objectTypeToClassCache.getUnchecked(type);
    if (!maybeClass.isPresent()) {
      throw new IllegalArgumentException("Could not load: " + type);
    }
    return maybeClass.get();
  }
550305
public static <T> Class<T> unwrap(Class<T> type) {
        if (type == null) {
            throw new IllegalArgumentException();
        }

        Class<T> unwrapped = (Class<T>) WRAP_TO_PRIMITIVE.get(type);
        return (unwrapped == null) ? type : unwrapped;
    }
1012971
static ClassNode boundUnboundedWildcards(ClassNode type) {
        if (type.isArray()) {
            return boundUnboundedWildcards(type.getComponentType()).makeArray();
        }
        ClassNode target = type.redirect();
        if (target == null || type == target || !isUsingGenericsOrIsArrayUsingGenerics(target)) return type;
        ClassNode newType = type.getPlainNodeReference();
        newType.setGenericsPlaceHolder(type.isGenericsPlaceHolder());
        newType.setGenericsTypes(boundUnboundedWildcards(type.getGenericsTypes(), target.getGenericsTypes()));
        return newType;
    }
366208
@SuppressWarnings ( "unchecked" )
    @Override
    public <T extends Address> T unwrap ( Class<T> type ) {
        if ( this.addr instanceof Address ) {
            return ( (Address) this.addr ).unwrap(type);
        }
        else if ( this.getClass().isAssignableFrom(type) ) {
            return (T) this;
        }
        return null;
    }