Skip to content

Commit

Permalink
Fix compilation issue due to jdk bug Inference fails for type variabl…
Browse files Browse the repository at this point in the history
  • Loading branch information
echarles committed Feb 20, 2012
1 parent c5582a1 commit bb6d140
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,7 @@ private boolean casSweepVotes(int cmp, int val) {
@SuppressWarnings("unchecked")
static <E> E cast(Object item) {
// assert item == null || item.getClass() != Node.class;
// Explicit cast, see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6302954
return (E) item;
}

Expand Down Expand Up @@ -653,7 +654,8 @@ private E xfer(E e, boolean haveData, int how, long nanos) {
}
}
LockSupport.unpark(p.waiter);
return LegacyLinkedTransferQueue.cast(item);
// Explicit cast, see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6302954
return (E) LegacyLinkedTransferQueue.cast(item);
}
}
Node n = p.next;
Expand Down Expand Up @@ -737,7 +739,8 @@ private E awaitMatch(Node s, Node pred, E e, boolean timed, long nanos) {
if (item != e) { // matched
// assert item != s;
s.forgetContents(); // avoid garbage
return LegacyLinkedTransferQueue.cast(item);
// Explicit cast, see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6302954
return (E) LegacyLinkedTransferQueue.cast(item);
}
if ((w.isInterrupted() || timed && nanos <= 0) &&
s.casItem(e, s)) { // cancel
Expand Down Expand Up @@ -825,7 +828,8 @@ private E firstDataItem() {
Object item = p.item;
if (p.isData) {
if (item != null && item != p) {
return LegacyLinkedTransferQueue.cast(item);
// Explicit cast, see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6302954
return (E) LegacyLinkedTransferQueue.cast(item);
}
}
else if (item == null) {
Expand Down Expand Up @@ -878,7 +882,8 @@ private void advance(Node prev) {
Object item = p.item;
if (p.isData) {
if (item != null && item != p) {
nextItem = LegacyLinkedTransferQueue.cast(item);
// Explicit cast, see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6302954
nextItem = (E) LegacyLinkedTransferQueue.cast(item);
nextNode = p;
return;
}
Expand Down

0 comments on commit bb6d140

Please sign in to comment.