Am 18.10.2014 18:59, schrieb Peter Levart:
[...]
The complete solution will require new API, but the
java.lang.reflect.Proxy API could be improved a bit too. With
introduction of default interface methods it is somehow broken now.
I find this a bit strange. A new API means at least JDK9. So JD
On 10/20/2014 11:25 AM, Cédric Champeau wrote:
For what it's worth, in Groovy, we have two separate pathes to
"implement classes at runtime", that is to say generating proxies. In
the case of an interface, we rely on the JDK proxy just because it is
*much* faster than generating a class throug
On 10/17/2014 11:58 AM, Paul Sandoz wrote:
On Oct 16, 2014, at 12:43 PM, Remi Forax wrote:
On 10/15/2014 06:54 PM, Paul Sandoz wrote:
Hi Remi,
I did some brief evaluation of this area.
MethodHandleProxies.asInterfaceInstance currently does not support proxying to
default methods. An Inter
On 22/10/2014 09:26, Peter Levart wrote:
On 10/20/2014 11:25 AM, Cédric Champeau wrote:
For what it's worth, in Groovy, we have two separate pathes to "implement
classes at runtime", that is to say generating proxies. In the case of an
interface, we rely on the JDK proxy just because it is *much
On 10/20/2014 11:25 AM, Cédric Champeau wrote:
For what it's worth, in Groovy, we have two separate pathes to "implement
classes at runtime", that is to say generating proxies. In the case of an
interface, we rely on the JDK proxy just because it is *much* faster than
generating a class through A
For what it's worth, in Groovy, we have two separate pathes to "implement
classes at runtime", that is to say generating proxies. In the case of an
interface, we rely on the JDK proxy just because it is *much* faster than
generating a class through ASM. I mean that generating a class in ASM is
orde
On Oct 18, 2014, at 6:59 PM, Peter Levart wrote:
>
> Hi Paul, Remi,
>
> The complete solution will require new API, but the java.lang.reflect.Proxy
> API could be improved a bit too. With introduction of default interface
> methods it is somehow broken now. Default interface methods enable in
On 10/17/2014 11:58 AM, Paul Sandoz wrote:
On Oct 16, 2014, at 12:43 PM, Remi Forax wrote:
On 10/15/2014 06:54 PM, Paul Sandoz wrote:
Hi Remi,
I did some brief evaluation of this area.
MethodHandleProxies.asInterfaceInstance currently does not support proxying to
default methods. An Inter
On Oct 16, 2014, at 12:43 PM, Remi Forax wrote:
>
> On 10/15/2014 06:54 PM, Paul Sandoz wrote:
>> Hi Remi,
>>
>> I did some brief evaluation of this area.
>>
>> MethodHandleProxies.asInterfaceInstance currently does not support proxying
>> to default methods. An InternalError will be thrown
On 10/15/2014 06:54 PM, Paul Sandoz wrote:
Hi Remi,
I did some brief evaluation of this area.
MethodHandleProxies.asInterfaceInstance currently does not support proxying to
default methods. An InternalError will be thrown if a default method is
invoked. It should be possible to fix using a t
Hi Remi,
I did some brief evaluation of this area.
MethodHandleProxies.asInterfaceInstance currently does not support proxying to
default methods. An InternalError will be thrown if a default method is
invoked. It should be possible to fix using a trusted internal IMPL_LOOKUP to
look up MHs th
Thinking a little bit more about that, you can almost use a lambda proxy
as a reflect proxy,
yes, almost because the lambda metafactory doesn't understand varargs.
class Main {
public static void print(Object... args) {
System.out.println(Arrays.toString(args));
}
public static void m
Am 09.10.2014 19:07, schrieb Remi Forax:
public static void main(String[] args) throws NoSuchFieldException,
IllegalArgumentException, IllegalAccessException {
Lookup lookup = MethodHandles.publicLookup().in(Consumer.class);
Field allowedModes = Lookup.class.getDeclaredField("allowedMod
Am 09.10.2014 17:32, schrieb Alessio Stalla:
[...]
Well, you can extend this technique by using more method references and
delegation (yes, even more levels of indirection!),
in short: I should just produce my own proxy system ;) Or in other
words, there is no proper replacement in the JDK for
public static void main(String[] args) throws NoSuchFieldException,
IllegalArgumentException, IllegalAccessException {
Lookup lookup = MethodHandles.publicLookup().in(Consumer.class);
Field allowedModes = Lookup.class.getDeclaredField("allowedModes");
allowedModes.setAccessible(true);
On Thu, Oct 9, 2014 at 5:22 PM, Jochen Theodorou wrote:
> Am 09.10.2014 17:02, schrieb Alessio Stalla:
>
>> "All problems in computer science can be solved by another level of
>> indirection"... "except for the problem of too many layers of
>> indirection".
>>
>> What about (untested):
>>
>> Cons
Am 09.10.2014 17:02, schrieb Alessio Stalla:
"All problems in computer science can be solved by another level of
indirection"... "except for the problem of too many layers of indirection".
What about (untested):
Consumer proxy = Proxy.newProxyInstance(...);
Consumer myConsumer = proxy::accept;
Am 09.10.2014 16:51, schrieb Vladimir Ivanov:
Jochen,
too bad no-one knows. Has anyone an idea for a better place to ask this?
(btw, because of the getSimpleName issue I can't use MethodHandleProxies)
FYI, I plan to get MethodType.toString() problem fixed in 8u40.
I wish you would know how o
"All problems in computer science can be solved by another level of
indirection"... "except for the problem of too many layers of indirection".
What about (untested):
Consumer proxy = Proxy.newProxyInstance(...);
Consumer myConsumer = proxy::accept;
If you keep the proxy inaccessible, nobody wil
Jochen,
too bad no-one knows. Has anyone an idea for a better place to ask this?
(btw, because of the getSimpleName issue I can't use MethodHandleProxies)
FYI, I plan to get MethodType.toString() problem fixed in 8u40.
Best regards,
Vladimir Ivanov
Am 06.10.2014 18:06, schrieb Jochen Theodo
too bad no-one knows. Has anyone an idea for a better place to ask this?
(btw, because of the getSimpleName issue I can't use MethodHandleProxies)
Am 06.10.2014 18:06, schrieb Jochen Theodorou:
Hi,
I find this a little odd and I wonder how you are supposed to do it
right. Or if that is a bug
Hi,
I find this a little odd and I wonder how you are supposed to do it
right. Or if that is a bug.
So I have a class implementing InvocationHandler and I used Proxy to
create a an proxied instance of Consumer. This is a functional interface
and I want to use its accept method for my purpose
22 matches
Mail list logo