src/share/classes/java/lang/invoke/MethodHandles.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
jdk Cdiff src/share/classes/java/lang/invoke/MethodHandles.java
src/share/classes/java/lang/invoke/MethodHandles.java
Print this page
rev 9490 : 8037210: Get rid of char-based descriptions 'J' of basic types
Reviewed-by: ?
*** 35,48 ****
import sun.invoke.util.Wrapper;
import sun.reflect.CallerSensitive;
import sun.reflect.Reflection;
import sun.reflect.misc.ReflectUtil;
import sun.security.util.SecurityConstants;
import static java.lang.invoke.MethodHandleStatics.*;
import static java.lang.invoke.MethodHandleNatives.Constants.*;
import java.util.concurrent.ConcurrentHashMap;
- import sun.security.util.SecurityConstants;
/**
* This class consists exclusively of static methods that operate on or return
* method handles. They fall into several categories:
* <ul>
--- 35,49 ----
import sun.invoke.util.Wrapper;
import sun.reflect.CallerSensitive;
import sun.reflect.Reflection;
import sun.reflect.misc.ReflectUtil;
import sun.security.util.SecurityConstants;
+ import java.lang.invoke.LambdaForm.BasicType;
+ import static java.lang.invoke.LambdaForm.BasicType.*;
import static java.lang.invoke.MethodHandleStatics.*;
import static java.lang.invoke.MethodHandleNatives.Constants.*;
import java.util.concurrent.ConcurrentHashMap;
/**
* This class consists exclusively of static methods that operate on or return
* method handles. They fall into several categories:
* <ul>
*** 2186,2212 ****
MethodHandle result = target;
for (int i = 0; i < insCount; i++) {
Object value = values[i];
Class<?> ptype = oldType.parameterType(pos+i);
if (ptype.isPrimitive()) {
! char btype = 'I';
Wrapper w = Wrapper.forPrimitiveType(ptype);
switch (w) {
! case LONG: btype = 'J'; break;
! case FLOAT: btype = 'F'; break;
! case DOUBLE: btype = 'D'; break;
}
// perform unboxing and/or primitive conversion
value = w.convert(value, ptype);
result = result.bindArgument(pos, btype, value);
continue;
}
value = ptype.cast(value); // throw CCE if needed
if (pos == 0) {
result = result.bindReceiver(value);
} else {
! result = result.bindArgument(pos, 'L', value);
}
}
return result;
}
--- 2187,2213 ----
MethodHandle result = target;
for (int i = 0; i < insCount; i++) {
Object value = values[i];
Class<?> ptype = oldType.parameterType(pos+i);
if (ptype.isPrimitive()) {
! BasicType btype = I_TYPE;
Wrapper w = Wrapper.forPrimitiveType(ptype);
switch (w) {
! case LONG: btype = J_TYPE; break;
! case FLOAT: btype = F_TYPE; break;
! case DOUBLE: btype = D_TYPE; break;
}
// perform unboxing and/or primitive conversion
value = w.convert(value, ptype);
result = result.bindArgument(pos, btype, value);
continue;
}
value = ptype.cast(value); // throw CCE if needed
if (pos == 0) {
result = result.bindReceiver(value);
} else {
! result = result.bindArgument(pos, L_TYPE, value);
}
}
return result;
}
src/share/classes/java/lang/invoke/MethodHandles.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File