Skip to content

Commit 38bbc22

Browse files
committed
parameterized return type of native get0
1 parent 498f6d5 commit 38bbc22

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/java.base/share/classes/java/lang/ref/Reference.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -359,15 +359,13 @@ public void runFinalization() {
359359
*/
360360
@IntrinsicCandidate
361361
public T get() {
362-
@SuppressWarnings("unchecked")
363-
T result = (T) get0();
364-
return result;
362+
return get0();
365363
}
366364

367365
/* Implementation of unintrinsified get(). Making get() native may lead
368366
* C2 to sometimes prefer the native implementation over the intrinsic.
369367
*/
370-
private native Object get0();
368+
private native T get0();
371369

372370
/**
373371
* Tests if the referent of this reference object is {@code obj}.

0 commit comments

Comments
 (0)