mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-01 12:41:50 +01:00
Fix thread safety issues in EntitySlice
This commit is contained in:
parent
3fce0ec0f5
commit
970be7a444
1 changed files with 38 additions and 0 deletions
38
nms-patches/EntitySlice.patch
Normal file
38
nms-patches/EntitySlice.patch
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
--- /home/matt/mc-dev-private//net/minecraft/server/EntitySlice.java 2015-03-22 19:06:47.125875941 +0000
|
||||||
|
+++ src/main/java/net/minecraft/server/EntitySlice.java 2015-03-22 19:06:47.125875941 +0000
|
||||||
|
@@ -12,7 +12,7 @@
|
||||||
|
|
||||||
|
public class EntitySlice<T> extends AbstractSet<T> {
|
||||||
|
|
||||||
|
- private static final Set<Class<?>> a = Sets.newHashSet();
|
||||||
|
+ private static final Set<Class<?>> a = Sets.newConcurrentHashSet(); // CraftBukkit
|
||||||
|
private final Map<Class<?>, List<T>> b = Maps.newHashMap();
|
||||||
|
private final Set<Class<?>> c = Sets.newIdentityHashSet();
|
||||||
|
private final Class<T> d;
|
||||||
|
@@ -40,7 +40,7 @@
|
||||||
|
Object object = iterator.next();
|
||||||
|
|
||||||
|
if (oclass.isAssignableFrom(object.getClass())) {
|
||||||
|
- this.a(object, oclass);
|
||||||
|
+ this.a((T) object, oclass);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -77,7 +77,7 @@
|
||||||
|
List list = (List) this.b.get(oclass);
|
||||||
|
|
||||||
|
if (list == null) {
|
||||||
|
- this.b.put(oclass, Lists.newArrayList(new Object[] { t0}));
|
||||||
|
+ this.b.put(oclass, Lists.newArrayList(t0));
|
||||||
|
} else {
|
||||||
|
list.add(t0);
|
||||||
|
}
|
||||||
|
@@ -125,7 +125,7 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
public Iterator<T> iterator() {
|
||||||
|
- return this.e.isEmpty() ? Iterators.emptyIterator() : Iterators.unmodifiableIterator(this.e.iterator());
|
||||||
|
+ return this.e.isEmpty() ? Iterators.<T>emptyIterator() : Iterators.unmodifiableIterator(this.e.iterator());
|
||||||
|
}
|
||||||
|
|
||||||
|
public int size() {
|
Loading…
Reference in a new issue