This commit is contained in:
Looly 2023-04-12 01:22:54 +08:00
parent d2e5155ac5
commit a96a95c988
216 changed files with 480 additions and 480 deletions

View File

@ -44,7 +44,7 @@ public class EnumConverter extends AbstractConverter {
@Override @Override
protected Object convertInternal(final Class<?> targetClass, final Object value) { protected Object convertInternal(final Class<?> targetClass, final Object value) {
Enum enumValue = tryConvertEnum(value, targetClass); Enum enumValue = tryConvertEnum(value, targetClass);
if (null == enumValue && ! value instanceof String) { if (null == enumValue && !(value instanceof String)) {
// 最后尝试先将value转String再valueOf转换 // 最后尝试先将value转String再valueOf转换
enumValue = Enum.valueOf((Class) targetClass, convertToStr(value)); enumValue = Enum.valueOf((Class) targetClass, convertToStr(value));
} }

View File

@ -34,7 +34,7 @@ public class MutableEntry<K, V> extends AbsEntry<K, V> implements Mutable<Map.En
* @param value * @param value
* @param <K> 键类型 * @param <K> 键类型
* @param <V> 值类型 * @param <V> 值类型
* @return * @return {@code MutableEntry}
*/ */
public static <K, V> MutableEntry<K, V> of(final K key, final V value) { public static <K, V> MutableEntry<K, V> of(final K key, final V value) {
return new MutableEntry<>(key, value); return new MutableEntry<>(key, value);

View File

@ -116,7 +116,7 @@ public class ActualTypeMapperPool {
for (int i = 0; i < typeParameters.length; i++) { for (int i = 0; i < typeParameters.length; i++) {
value = typeArguments[i]; value = typeArguments[i];
// 跳过泛型变量对应泛型变量的情况 // 跳过泛型变量对应泛型变量的情况
if(! value instanceof TypeVariable){ if(!(value instanceof TypeVariable)){
typeMap.put(typeParameters[i], value); typeMap.put(typeParameters[i], value);
} }
} }

View File

@ -86,7 +86,7 @@ public class HttpUrlConnectionUtil {
*/ */
public static HttpURLConnection openHttp(final URL url, final Proxy proxy) throws IORuntimeException { public static HttpURLConnection openHttp(final URL url, final Proxy proxy) throws IORuntimeException {
final URLConnection conn = openConnection(url, proxy); final URLConnection conn = openConnection(url, proxy);
if (! conn instanceof HttpURLConnection) { if (!(conn instanceof HttpURLConnection)) {
// 防止其它协议造成的转换异常 // 防止其它协议造成的转换异常
throw new HttpException("'{}' of URL [{}] is not a http connection, make sure URL is format for http.", throw new HttpException("'{}' of URL [{}] is not a http connection, make sure URL is format for http.",
conn.getClass().getName(), url); conn.getClass().getName(), url);