java.lang.IllegalAccessException: Class com.hieasy.comm.util.MyStrUtils can not access a member of class com.hieasy.e3.domain.natives.doc.Dianyuan with modifiers "private"
at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:102)
public static <T> String joinListField(List<T> list, String fieldTag, String separator ) throws Exception{ List<Object> array=new ArrayList<>(); for(T t:list){ Field field = t.getClass().getDeclaredField(fieldTag); // field.setAccessible(true); Object resultValue = field.get(t); array.add(resultValue); } return array == null ? null : join(array, separator, 0, array.size()); }
缺少了注释行导致类不能访问