fixed tons of null pointers after loading objects from db

This commit is contained in:
Light2
2014-05-04 22:47:05 +02:00
parent a4216f76b5
commit ae33de15c5
17 changed files with 71 additions and 36 deletions
+10 -8
View File
@@ -59,7 +59,7 @@ public class SWGList<E> implements List<E>, Serializable {
private byte viewType;
private short updateType;
@NotPersistent
protected transient final Object objectMutex = new Object();
protected transient Object objectMutex = new Object();
public SWGList() { }
@@ -69,6 +69,11 @@ public class SWGList<E> implements List<E>, Serializable {
this.updateType = (short) updateType;
}
public void init() {
objectMutex = new Object();
updateCounter = 1;
}
@Override
public boolean add(E e) {
synchronized(objectMutex) {
@@ -420,7 +425,7 @@ public class SWGList<E> implements List<E>, Serializable {
messageBuilder.sendListDelta(viewType, updateType, buffer);
}
@Override
public boolean removeIf(Predicate<? super E> filter) {
return false;
@@ -433,20 +438,17 @@ public class SWGList<E> implements List<E>, Serializable {
@Override
public Stream<E> stream() {
// TODO Auto-generated method stub
return null;
return list.stream();
}
@Override
public Stream<E> parallelStream() {
// TODO Auto-generated method stub
return null;
return list.parallelStream();
}
@Override
public void forEach(Consumer<? super E> action) {
// TODO Auto-generated method stub
list.forEach(action);
}
@Override