[Arakhnę-Dev] [4] Fixing template cast warning.

[ Thread Index | Date Index | More arakhne.org/dev Archives ]


Revision: 4
Author:   galland
Date:     2008-09-26 14:41:12 +0200 (Fri, 26 Sep 2008)

Log Message:
-----------
Fixing template cast warning.

Modified Paths:
--------------
    trunk/src/main/java/org/arakhne/util/ref/SoftValueMap.java
    trunk/src/main/java/org/arakhne/util/ref/WeakValueMap.java


Modified: trunk/src/main/java/org/arakhne/util/ref/SoftValueMap.java
===================================================================
--- trunk/src/main/java/org/arakhne/util/ref/SoftValueMap.java	2008-09-26 12:40:40 UTC (rev 3)
+++ trunk/src/main/java/org/arakhne/util/ref/SoftValueMap.java	2008-09-26 12:41:12 UTC (rev 4)
@@ -1,7 +1,7 @@
 /* 
- * $Id: WeakValueMap.java,v 1.1 2007-02-20 08:52:37 sgalland Exp $
+ * $Id$
  * 
- * Copyright (C) 2005-2007 Stéphane GALLAND
+ * Copyright (C) 2005-2008 Stéphane GALLAND
  * 
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -99,7 +99,6 @@
 	 * @return the internal representation of the value.
 	 * @see #maskNull(Object)
 	 */
-	@SuppressWarnings("unchecked")
 	protected static <V> V unmaskNull(V value) {
 		return (value==NULL_VALUE) ? null : value;
 	}
@@ -199,8 +198,9 @@
 	public void expurgeQueuedReferences() {
 		Reference<? extends V> o;
 		while((o = this.queue.poll()) != null) {
-			if (o instanceof Entry) {
-				this.map.remove(((Entry<K,V>)o).getKey());
+			if (o instanceof Value) {
+				
+				this.map.remove(((Value<?,?>)o).getKey());
 			}
 			o.clear();
 		}
@@ -229,8 +229,8 @@
 		value = null;
 
 		while((o = this.queue.poll()) != null) {
-			if (o instanceof Entry) {
-				this.map.remove(((Entry<K,V>)o).getKey());
+			if (o instanceof Value) {
+				this.map.remove(((Value<?,?>)o).getKey());
 			}
 			o.clear();
 		}

Modified: trunk/src/main/java/org/arakhne/util/ref/WeakValueMap.java
===================================================================
--- trunk/src/main/java/org/arakhne/util/ref/WeakValueMap.java	2008-09-26 12:40:40 UTC (rev 3)
+++ trunk/src/main/java/org/arakhne/util/ref/WeakValueMap.java	2008-09-26 12:41:12 UTC (rev 4)
@@ -101,7 +101,6 @@
 	 * @return the internal representation of the value.
 	 * @see #maskNull(Object)
 	 */
-	@SuppressWarnings("unchecked")
 	protected static <V> V unmaskNull(V value) {
 		return (value==NULL_VALUE) ? null : value;
 	}
@@ -201,8 +200,8 @@
 	public void expurgeQueuedReferences() {
 		Reference<? extends V> o;
 		while((o = this.queue.poll()) != null) {
-			if (o instanceof Entry) {
-				this.map.remove(((Entry<K,V>)o).getKey());
+			if (o instanceof Value) {
+				this.map.remove(((Value<?,?>)o).getKey());
 			}
 			o.clear();
 		}
@@ -231,8 +230,8 @@
 		value = null;
 
 		while((o = this.queue.poll()) != null) {
-			if (o instanceof Entry) {
-				this.map.remove(((Entry<K,V>)o).getKey());
+			if (o instanceof Value) {
+				this.map.remove(((Value<?,?>)o).getKey());
 			}
 			o.clear();
 		}


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/