Security issues: public static collections

This commit is contained in:
thatsIch
2015-03-26 11:13:24 +01:00
parent 9bf8b4388f
commit 234d97b8ce
3 changed files with 6 additions and 4 deletions
+3 -2
View File
@@ -19,6 +19,7 @@
package appeng.me.cache;
import java.util.Collection;
import java.util.Deque;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Map.Entry;
@@ -64,7 +65,7 @@ public class NetworkMonitor<T extends IAEStack<T>> extends MEMonitorHandler<T>
this.myChannel = chan;
}
final static public LinkedList DEPTH = new LinkedList();
private final static Deque<NetworkMonitor<?>> DEPTH = new LinkedList<NetworkMonitor<?>>();
@Override
protected void postChangesToListeners(Iterable<T> changes, BaseActionSource src)
@@ -113,7 +114,7 @@ public class NetworkMonitor<T extends IAEStack<T>> extends MEMonitorHandler<T>
}
}
Object last = DEPTH.pop();
NetworkMonitor<?> last = DEPTH.pop();
if ( last != this )
throw new RuntimeException( "Invalid Access to Networked Storage API detected." );
}