Author: j16sdiz
Date: 2009-02-13 14:05:11 +0000 (Fri, 13 Feb 2009)
New Revision: 25610
Modified:
trunk/freenet/src/freenet/support/LRUQueue.java
Log:
more null checks
Modified: trunk/freenet/src/freenet/support/LRUQueue.java
===================================================================
--- trunk/freenet/src/freenet/support/LRUQueue.java 2009-02-13 14:01:28 UTC
(rev 25609)
+++ trunk/freenet/src/freenet/support/LRUQueue.java 2009-02-13 14:05:11 UTC
(rev 25610)
@@ -31,6 +31,9 @@
* a duplicate entry in the queue.
*/
public final synchronized void push(T obj) {
+ if (obj == null)
+ throw new NullPointerException();
+
QItem<T> insert = (QItem<T>) hash.get(obj);
if (insert == null) {
insert = new QItem<T>(obj);
@@ -46,6 +49,9 @@
* push to bottom (least recently used position)
*/
public synchronized void pushLeast(T obj) {
+ if (obj == null)
+ throw new NullPointerException();
+
QItem<T> insert = (QItem<T>) hash.get(obj);
if (insert == null) {
insert = new QItem<T>(obj);
_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs