mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8150829: Enhanced drop-args, identity and default constant, varargs adjustment
Reviewed-by: psandoz, mhaupt, jrose
This commit is contained in:
parent
33a3b1cdf0
commit
284ec15fed
8 changed files with 490 additions and 66 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -216,13 +216,7 @@ public class MethodHandleProxies {
|
|||
}
|
||||
|
||||
private static MethodHandle bindCaller(MethodHandle target, Class<?> hostClass) {
|
||||
MethodHandle cbmh = MethodHandleImpl.bindCaller(target, hostClass);
|
||||
if (target.isVarargsCollector()) {
|
||||
MethodType type = cbmh.type();
|
||||
int arity = type.parameterCount();
|
||||
return cbmh.asVarargsCollector(type.parameterType(arity-1));
|
||||
}
|
||||
return cbmh;
|
||||
return MethodHandleImpl.bindCaller(target, hostClass).withVarargs(target.isVarargsCollector());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue