garydgregory commented on code in PR #664: URL: https://github.com/apache/commons-collections/pull/664#discussion_r2596364560
########## src/main/java/org/apache/commons/collections4/list/ExtendedTreeList.java: ########## @@ -0,0 +1,284 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.commons.collections4.list; + +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.ListIterator; +import java.util.Objects; + +/** + * This class extends {@link TreeList}. It provides some methods that are needed + * in benchmarking the actual {@code TreeList} against the + * {@link IndexedLinkedList}. + */ +public class ExtendedTreeList<E> extends TreeList<E> { Review Comment: Hello @coderodde Thank you for your quick reply. I think I see what's happening here: `java.util.LinkedList<E>` implements `Deque<E>` but `org.apache.commons.collections4.list.TreeList<E>` doesn't. It looks like `ExtendedTreeList` implements `Deque` methods but doesn't actually implement the interface with an `implements Deque<E>` in the code. Then I see `IndexedLinkedList` implements `Deque`. So we have a bit of a mismatch. So: - It's good that `IndexedLinkedList` implements `Deque<E>` - It's not good that `ExtendedTreeList` doesn't If all of that makes sense and you agree, do you think that `org.apache.commons.collections4.list.TreeList<E>` should implement `Deque<E>` _first_, then `ExtendedTreeList` would become superflous. If you agree, you can create a PR that causes `org.apache.commons.collections4.list.TreeList<E>` to implement `Deque<E>`, with tests 😉 Another wrinkle is that `IndexedLinkedList` doesn't fit in the JRE's collection framework by extending `java.util.AbstractSequentialList<E>` or `java.util.AbstractList<E>`. Is there a reason to not fit it in? Thank. you! -- 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]
