Security issues: public static collections
This commit is contained in:
parent
9bf8b4388f
commit
234d97b8ce
3 changed files with 6 additions and 4 deletions
|
@ -19,6 +19,7 @@
|
||||||
package appeng.client.render;
|
package appeng.client.render;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
@ -48,7 +49,7 @@ public class BusRenderer implements IItemRenderer
|
||||||
public static final BusRenderer INSTANCE = new BusRenderer();
|
public static final BusRenderer INSTANCE = new BusRenderer();
|
||||||
|
|
||||||
public final RenderBlocksWorkaround renderer = new RenderBlocksWorkaround();
|
public final RenderBlocksWorkaround renderer = new RenderBlocksWorkaround();
|
||||||
public static final HashMap<Integer, IPart> RENDER_PART = new HashMap<Integer, IPart>();
|
private static final Map<Integer, IPart> RENDER_PART = new HashMap<Integer, IPart>();
|
||||||
|
|
||||||
public IPart getRenderer(ItemStack is, IPartItem c)
|
public IPart getRenderer(ItemStack is, IPartItem c)
|
||||||
{
|
{
|
||||||
|
|
|
@ -33,7 +33,7 @@ import appeng.tile.AEBaseTile;
|
||||||
public class TileItemGen extends AEBaseTile implements IInventory
|
public class TileItemGen extends AEBaseTile implements IInventory
|
||||||
{
|
{
|
||||||
|
|
||||||
public static final Queue<ItemStack> POSSIBLE_ITEMS = new LinkedList<ItemStack>();
|
private static final Queue<ItemStack> POSSIBLE_ITEMS = new LinkedList<ItemStack>();
|
||||||
|
|
||||||
public TileItemGen() {
|
public TileItemGen() {
|
||||||
if ( POSSIBLE_ITEMS.isEmpty() )
|
if ( POSSIBLE_ITEMS.isEmpty() )
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
package appeng.me.cache;
|
package appeng.me.cache;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
import java.util.Deque;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
@ -64,7 +65,7 @@ public class NetworkMonitor<T extends IAEStack<T>> extends MEMonitorHandler<T>
|
||||||
this.myChannel = chan;
|
this.myChannel = chan;
|
||||||
}
|
}
|
||||||
|
|
||||||
final static public LinkedList DEPTH = new LinkedList();
|
private final static Deque<NetworkMonitor<?>> DEPTH = new LinkedList<NetworkMonitor<?>>();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void postChangesToListeners(Iterable<T> changes, BaseActionSource src)
|
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 )
|
if ( last != this )
|
||||||
throw new RuntimeException( "Invalid Access to Networked Storage API detected." );
|
throw new RuntimeException( "Invalid Access to Networked Storage API detected." );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue