ppkarwasz commented on PR #628: URL: https://github.com/apache/commons-collections/pull/628#issuecomment-3198129709
@JoergBudi, > About IteratorChain and returning this (e.g. with a boolean marking remove() to throw an exception): While semantically that would work you would violate the marker interface contract (you can't dynamically add Unmodifiable to the instance so you either lie before or after calling toUnmodifiable()). So I think you continue to need similar unwrapping code knowing the possible classes one nesting level deeper, however it is difficult to think that through without actually trying it out. When I talked about returning `this`, I was rather thinking that `IteratorChain.toUnmodifiable()` would return a new derivative class `UnmodifiableIteratorChain`, while `UnmodifiableIteratorChain.toUnmodifiable()` would return this. > About this PR: I checked, that on a millisecond scale, the performance benefit of this PR is not really measurable up to a 1000 nestings. After that (5k nestings), the PR indeed avoids the StackOverflowError, but as no one has created a defect about that, I guess so deep nestings are uncommon. So have you got suggestions how to go on here ? Shall we merge the PR as is or have you got other improvements in mind beside the UnmodifiableConvertible I could add ? I think we should merge it as is. Can you add yourself to the `changes.xml` file? @garydgregory, any objections? -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
