XenoAmess edited a comment on issue #429: ArrayUtils: merge 8 isSameLength,isEmpty,isNotEmpty into one function each. URL: https://github.com/apache/commons-lang/pull/429#issuecomment-498867087 > Wouldn't it allow for `ArrayUtils.isSameLength("this is a test", "a test this is")`? Which would actually result in `IllegalArgumentException` in `getLength`, but could be misleading. > > IMHO, the current way is better, or if someone could come up with a simplification using generics, that could work too. But using `Object` changes the semantics of the method - and not exactly in an intuitive way. Yes I agree. You are right. The uncompatibility shall be fixed on the ArrayUtils.getLength side. ArrayUtils.getLength should be somehow looks like ArrayUtils.remove functions. I will try it this way. ---------- I see. ArrayUtils.remove is made 8 functions because ArrayUtils.remove(null) is meaningless, and will only throw IndexOutOfBoundsException. But in ArrayUtils.getLength things are different. ArrayUtils.getLength(null) is meaningful, and will return 0. If we split ArrayUtils.getLength into several functions then we can not do ArrayUtils.getLength(null) any more. I guess I fully understand this thing now.
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
