Package org.pathvisio.libgpml.debug
Class DebugList<E>
java.lang.Object
org.pathvisio.libgpml.debug.DebugList<E>
- Type Parameters:
 E- List element type
- All Implemented Interfaces:
 java.lang.Iterable<E>,java.util.Collection<E>,java.util.List<E>
public class DebugList<E>
extends java.lang.Object
implements java.util.List<E>
This is a List that helps in the search for ConcurrentModification problems.
 Most List's in the collection interface are fail-fast, if you modify a list
 while iterating over it, a ConcurrentModificationException might be thrown.
 The problem is that this exception is thrown when this is detected, which is
 in the iterator.next() method, but it does not tell where the modification
 occurred.
 DebugList saves a stack trace for each modification made to it. Then, when a
 the exceptional situation arises, it also throws a
 ConcurrentModificationException but adds the point of the last modification
 as the cause, which should help greatly in debugging the problem.
 This is intended to debug problems with single-threaded usage of lists, I
 don't know how useful it will be for debugging multi-threading problems.
 This class wraps around an ordinary ArrayList<E>
- Author:
 - unknown
 
- 
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDebugList.DebugIterator<E>An iterator to go with the DebugList. - 
Field Summary
 - 
Constructor Summary
Constructors Constructor Description DebugList() - 
Method Summary
Modifier and Type Method Description voidadd(int arg0, E arg1)booleanadd(E arg0)booleanaddAll(int arg0, java.util.Collection<? extends E> arg1)booleanaddAll(java.util.Collection<? extends E> arg0)voidclear()booleancontains(java.lang.Object arg0)booleancontainsAll(java.util.Collection<?> arg0)Eget(int arg0)private static voidhelper()intindexOf(java.lang.Object arg0)booleanisEmpty()java.util.Iterator<E>iterator()intlastIndexOf(java.lang.Object arg0)java.util.ListIterator<E>listIterator()java.util.ListIterator<E>listIterator(int arg0)Eremove(int arg0)booleanremove(java.lang.Object arg0)booleanremoveAll(java.util.Collection<?> arg0)booleanretainAll(java.util.Collection<?> arg0)Eset(int arg0, E arg1)intsize()java.util.List<E>subList(int arg0, int arg1)java.lang.Object[]toArray()<T> T[]toArray(T[] arg0)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.lang.Iterable
forEachMethods inherited from interface java.util.List
equals, hashCode, replaceAll, sort, spliterator 
- 
Field Details
- 
cause
private java.lang.Throwable cause - 
delegate
 - 
modCount
int modCount 
 - 
 - 
Constructor Details
- 
DebugList
public DebugList() 
 - 
 - 
Method Details
- 
add
 - 
add
- Specified by:
 addin interfacejava.util.List<E>
 - 
addAll
 - 
addAll
- Specified by:
 addAllin interfacejava.util.List<E>
 - 
clear
public void clear() - 
contains
public boolean contains(java.lang.Object arg0) - 
containsAll
public boolean containsAll(java.util.Collection<?> arg0) - 
get
- Specified by:
 getin interfacejava.util.List<E>
 - 
indexOf
public int indexOf(java.lang.Object arg0)- Specified by:
 indexOfin interfacejava.util.List<E>
 - 
isEmpty
public boolean isEmpty() - 
iterator
 - 
lastIndexOf
public int lastIndexOf(java.lang.Object arg0)- Specified by:
 lastIndexOfin interfacejava.util.List<E>
 - 
listIterator
- Specified by:
 listIteratorin interfacejava.util.List<E>
 - 
listIterator
- Specified by:
 listIteratorin interfacejava.util.List<E>
 - 
remove
public boolean remove(java.lang.Object arg0) - 
remove
- Specified by:
 removein interfacejava.util.List<E>
 - 
removeAll
public boolean removeAll(java.util.Collection<?> arg0) - 
retainAll
public boolean retainAll(java.util.Collection<?> arg0) - 
set
- Specified by:
 setin interfacejava.util.List<E>
 - 
size
public int size() - 
subList
- Specified by:
 subListin interfacejava.util.List<E>
 - 
toArray
public java.lang.Object[] toArray() - 
toArray
public <T> T[] toArray(T[] arg0) - 
helper
private static void helper() 
 -