apache / shenyu

Apache ShenYu is a Java native API Gateway for service proxy, protocol conversion and API governance.
https://shenyu.apache.org/
Apache License 2.0
8.44k stars 2.93k forks source link

[Question] Whether `org.apache.shenyu.common.utils.CollectionUtils` should be replaced? #2312

Closed midnight2104 closed 2 years ago

midnight2104 commented 2 years ago

Question

I found that shenyu uses org.apache.shenyu.common.utils.CollectionUtils, but org.apache.commons.collections4.CollectionUtils provides the corresponding methods. Do I need to replace org.apache.shenyu.common.utils.CollectionUtils with org.apache.commons.collections4.CollectionUtils.


public class CollectionUtils {

    /**
     * Is empty boolean.
     *
     * @param coll the coll
     * @return the boolean
     */
    public static boolean isEmpty(final Collection<?> coll) {
        return coll == null || coll.isEmpty();
    }

    /**
     * Is not empty boolean.
     *
     * @param coll the coll
     * @return the boolean
     */
    public static boolean isNotEmpty(final Collection<?> coll) {
        return !isEmpty(coll);
    }
}

    public static boolean isEmpty(Collection<?> coll) {
        return coll == null || coll.isEmpty();
    }

    public static boolean isNotEmpty(Collection<?> coll) {
        return !isEmpty(coll);
    }

If a replacement is needed, please assign that task to me, thanks~

yu199195 commented 2 years ago

yes, you can

midnight2104 commented 2 years ago

merged pr https://github.com/apache/incubator-shenyu/pull/2324