mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
fix code
This commit is contained in:
parent
d2e5155ac5
commit
a96a95c988
@ -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));
|
||||||
}
|
}
|
||||||
|
@ -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);
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user