Surpress some warnings

This commit is contained in:
Norman Maurer 2012-03-03 19:33:02 +01:00
parent 66f8de91b1
commit 520bf78f18
2 changed files with 5 additions and 2 deletions

View File

@ -626,6 +626,7 @@ public class LegacyLinkedTransferQueue<E> extends AbstractQueue<E>
* @return an item if matched, else e
* @throws NullPointerException if haveData mode but e is null
*/
@SuppressWarnings("unchecked")
private E xfer(E e, boolean haveData, int how, long nanos) {
if (haveData && e == null) {
throw new NullPointerException();
@ -728,6 +729,7 @@ public class LegacyLinkedTransferQueue<E> extends AbstractQueue<E>
* @param nanos timeout in nanosecs, used only if timed is true
* @return matched item, or e if unmatched on interrupt or timeout
*/
@SuppressWarnings("unchecked")
private E awaitMatch(Node s, Node pred, E e, boolean timed, long nanos) {
long lastTime = timed ? System.nanoTime() : 0L;
Thread w = Thread.currentThread();
@ -823,6 +825,7 @@ public class LegacyLinkedTransferQueue<E> extends AbstractQueue<E>
* Returns the item in the first unmatched node with isData; or
* null if none. Used by peek.
*/
@SuppressWarnings("unchecked")
private E firstDataItem() {
for (Node p = head; p != null; p = succ(p)) {
Object item = p.item;
@ -874,6 +877,7 @@ public class LegacyLinkedTransferQueue<E> extends AbstractQueue<E>
/**
* Moves to next node after prev, or first node if prev null.
*/
@SuppressWarnings("unchecked")
private void advance(Node prev) {
lastPred = lastRet;
lastRet = prev;

View File

@ -81,6 +81,7 @@ import java.util.concurrent.locks.LockSupport;
* @param <E> the type of elements held in this collection
*/
@SuppressWarnings("restriction")
public class LinkedTransferQueue<E> extends AbstractQueue<E>
implements BlockingQueue<E>, java.io.Serializable {
private static final long serialVersionUID = -3223113410248163686L;
@ -529,8 +530,6 @@ public class LinkedTransferQueue<E> extends AbstractQueue<E>
return false;
}
private static final long serialVersionUID = -3375979862319811754L;
// Unsafe mechanics
private static final sun.misc.Unsafe UNSAFE;
private static final long itemOffset;