mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
Revert "fix(5.4.1): 修改code smell"
This reverts commit e27eb929
This commit is contained in:
parent
e27eb9299b
commit
c560991b73
@ -1,10 +1,6 @@
|
|||||||
package cn.hutool.core.annotation;
|
package cn.hutool.core.annotation;
|
||||||
|
|
||||||
import java.lang.annotation.Documented;
|
import java.lang.annotation.*;
|
||||||
import java.lang.annotation.ElementType;
|
|
||||||
import java.lang.annotation.Retention;
|
|
||||||
import java.lang.annotation.Target;
|
|
||||||
import java.lang.annotation.RetentionPolicy;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 叶容器-当对象存在树型结构,通过此注解标注属性告知存储位置
|
* 叶容器-当对象存在树型结构,通过此注解标注属性告知存储位置
|
||||||
|
@ -10,9 +10,7 @@ import java.beans.IntrospectionException;
|
|||||||
import java.beans.PropertyDescriptor;
|
import java.beans.PropertyDescriptor;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.util.List;
|
import java.util.*;
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 树结构转换工具
|
* 树结构转换工具
|
||||||
@ -28,13 +26,6 @@ import java.util.ArrayList;
|
|||||||
*/
|
*/
|
||||||
public class TreeConvert {
|
public class TreeConvert {
|
||||||
|
|
||||||
/**
|
|
||||||
* 构造私有化,静态方法不需要暴露公共构造器
|
|
||||||
* 修复 <code>Add a private constructor to hide the implicit public one</code>
|
|
||||||
*/
|
|
||||||
private TreeConvert() {
|
|
||||||
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* 生成树结构
|
* 生成树结构
|
||||||
* 通过反射检测LeafCollection注解,转换为父子结构容器,子数据装入LeafCollection容器中
|
* 通过反射检测LeafCollection注解,转换为父子结构容器,子数据装入LeafCollection容器中
|
||||||
@ -96,11 +87,8 @@ public class TreeConvert {
|
|||||||
* @throws IntrospectionException e
|
* @throws IntrospectionException e
|
||||||
* @throws InvocationTargetException e
|
* @throws InvocationTargetException e
|
||||||
* @throws IllegalAccessException e
|
* @throws IllegalAccessException e
|
||||||
*
|
|
||||||
* 2020-08-26 修复方法名过长
|
|
||||||
*/
|
*/
|
||||||
private static <T> List<T> sort(T root, Collection<T> elements, LeafDecide<T> leafDecide, Class<?> clazz, Field leafField)
|
private static <T> List<T> sort(T root, Collection<T> elements, LeafDecide<T> leafDecide, Class<?> clazz, Field leafField) throws IntrospectionException, InvocationTargetException, IllegalAccessException {
|
||||||
throws IntrospectionException, InvocationTargetException, IllegalAccessException {
|
|
||||||
List<T> subMenu = null;
|
List<T> subMenu = null;
|
||||||
for (T element : elements) {
|
for (T element : elements) {
|
||||||
if (leafDecide.isLeaf(root, element)) {
|
if (leafDecide.isLeaf(root, element)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user