Author: xor
Date: 2009-04-09 10:19:17 +0000 (Thu, 09 Apr 2009)
New Revision: 26673
Modified:
trunk/freenet/src/freenet/support/DoublyLinkedList.java
trunk/freenet/src/freenet/support/DoublyLinkedListImpl.java
Log:
Explain when to use these and un-deprecate them.
Problem: GPL is missing. Can we add it?
Modified: trunk/freenet/src/freenet/support/DoublyLinkedList.java
===================================================================
--- trunk/freenet/src/freenet/support/DoublyLinkedList.java 2009-04-09
00:10:10 UTC (rev 26672)
+++ trunk/freenet/src/freenet/support/DoublyLinkedList.java 2009-04-09
10:19:17 UTC (rev 26673)
@@ -4,32 +4,12 @@
/**
* Framework for managing a doubly linked list.
+ * The purpose of DoublyLinkedList is simply and solely so that
+ * we can override the entries with our own classes. This makes
+ * removal for example extremely fast: O(1) not O(n).
+ * In any other case we can use LinkedList.
* @author tavin
*/
-/* FIXME sdiz said:
-"but I really *hate* the idea of using DoublyLinkedList and its friends.
-
-It is a ugly hack for quick iteration of list in the early days, and can be
replaced LinkList using ListIternator in most cases.
-
-- The performance benefit is marginal.
-- Custom code like these make casual contributor less likely.
-- The class was created in 2005 era, and I can still find bugs in recent
months.
-
-Keep it out from the new code if you can.
-
-IF you REALLY HAVE to use it, PLEASE add a junit test for all new method you
created."
-
-----------
-toad replied:
-> The purpose of DoublyLinkedList is simply and solely so that
-> we can override the entries with our own classes. This makes
-> removal for example extremely
-> fast: O(1) not O(n). In any other case we can use LinkedList.
------------
-
-so should we keep this class and use it everywhere or not?
- */
-...@deprecated
public interface DoublyLinkedList<T extends DoublyLinkedList.Item<?>> extends
Iterable<T> {
// public abstract DoublyLinkedList<T> clone();
Modified: trunk/freenet/src/freenet/support/DoublyLinkedListImpl.java
===================================================================
--- trunk/freenet/src/freenet/support/DoublyLinkedListImpl.java 2009-04-09
00:10:10 UTC (rev 26672)
+++ trunk/freenet/src/freenet/support/DoublyLinkedListImpl.java 2009-04-09
10:19:17 UTC (rev 26673)
@@ -5,13 +5,14 @@
import java.util.NoSuchElementException;
/**
- * DoublyLinkedList implementation.
+ * DoublyLinkedList implementation. See DoublyLinkedList for an explanation
+ * when to use this.
+ *
* @author tavin
*
* TODO: there are still some unimplemented methods
* -- it remains to be seen if they are needed at all
*/
-...@deprecated
public class DoublyLinkedListImpl<T extends DoublyLinkedList.Item<? extends
T>> implements DoublyLinkedList<T> {
protected int size;
_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs