Mercurial > hg > graal-jvmci-8
comparison graal/com.oracle.truffle.api/src/com/oracle/truffle/api/CompilerDirectives.java @ 10650:b6e46324233f
Make CompilerDirectives.unsafeCast a generic method.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Mon, 08 Jul 2013 00:05:30 +0200 |
parents | ac8b195fd3aa |
children | d2055a110396 |
comparison
equal
deleted
inserted
replaced
10649:ac8b195fd3aa | 10650:b6e46324233f |
---|---|
132 * | 132 * |
133 * @param value the value that is known to have the specified type | 133 * @param value the value that is known to have the specified type |
134 * @param clazz the specified type of the value | 134 * @param clazz the specified type of the value |
135 * @return the value | 135 * @return the value |
136 */ | 136 */ |
137 @SuppressWarnings("unchecked") | |
137 @Unsafe | 138 @Unsafe |
138 public static Object unsafeCast(Object value, Class clazz) { | 139 public static <T> T unsafeCast(Object value, Class<T> clazz) { |
139 return value; | 140 return (T) value; |
140 } | 141 } |
141 } | 142 } |