Re: MethodHandles.publicLookup().in() returns Lookup with no permissions?

2020-11-24 Thread Mandy Chung
On 11/24/20 11:21 AM, Simone Bordet wrote: Hi, On Tue, Nov 24, 2020 at 7:35 PM Alan Bateman wrote: On 24/11/2020 18:21, Simone Bordet wrote: Hi, testing the Jetty MethodHandle usages we encountered this situation: .class org.openjdk.mh.Main Class klass = Main.class;

Re: MethodHandles.publicLookup().in() returns Lookup with no permissions?

2020-11-24 Thread Simone Bordet
Hi, On Tue, Nov 24, 2020 at 7:35 PM Alan Bateman wrote: > On 24/11/2020 18:21, Simone Bordet wrote: > > Hi, > > > > testing the Jetty MethodHandle usages we encountered this situation: > > > > .class org.openjdk.mh.Main > > > > Class klass = Main.class; > > MethodHandles.Lookup lookup =

Re: MethodHandles.publicLookup().in() returns Lookup with no permissions?

2020-11-24 Thread Mandy Chung
On 11/24/20 10:21 AM, Simone Bordet wrote: Hi, testing the Jetty MethodHandle usages we encountered this situation: .class org.openjdk.mh.Main Class klass = Main.class; MethodHandles.Lookup lookup = MethodHandles.publicLookup().in(klass); MethodHandle handle = lookup.findVirtual(klass,

Re: MethodHandles.publicLookup().in() returns Lookup with no permissions?

2020-11-24 Thread Alan Bateman
On 24/11/2020 18:21, Simone Bordet wrote: Hi, testing the Jetty MethodHandle usages we encountered this situation: .class org.openjdk.mh.Main Class klass = Main.class; MethodHandles.Lookup lookup = MethodHandles.publicLookup().in(klass); MethodHandle handle = lookup.findVirtual(klass,

MethodHandles.publicLookup().in() returns Lookup with no permissions?

2020-11-24 Thread Simone Bordet
Hi, testing the Jetty MethodHandle usages we encountered this situation: .class org.openjdk.mh.Main Class klass = Main.class; MethodHandles.Lookup lookup = MethodHandles.publicLookup().in(klass); MethodHandle handle = lookup.findVirtual(klass, "test", MethodType.methodType(String.class));

Re[2]: Why service provider method is called "provider", but not "provide"?

2020-11-24 Thread Alex Orlov
Oh, I seem to get it finally. Thank everyone for help, because I like to understand everything I work with. Up to now when I used "provider()" I asked myself — what the provider was.   But could anyone explain, why the folder, in META-INF with provider names is called "services"? I mean

Re: Why service provider method is called "provider", but not "provide"?

2020-11-24 Thread Andrew Dinn
On 24/11/2020 12:55, Alex Orlov wrote: Oh, I seem to get it finally. Thank everyone for help, because I like to understand everything I work with. Up to now when I used "provider()" I asked myself — what the provider was. But could anyone explain, why the folder, in META-INF with provider

Re: Why service provider method is called "provider", but not "provide"?

2020-11-24 Thread Alan Bateman
On 24/11/2020 06:46, Alex Orlov wrote: Could you then explain the difference between service and service provider? As I understand you’re saying they are the same. The second paragraph of the class description attempts to establish the terminology. The "service" is the well known interface,

Re: Why service provider method is called "provider", but not "provide"?

2020-11-24 Thread David Holmes
On 24/11/2020 5:38 pm, Alex Orlov wrote: >The provider() method returns an instance of a class that provides a >given service. provider() could be called serviceProvider() or >serviceImplementor() - but providor() suffices. Following this logic we can change hashCode() in Object to

Re[2]: Why service provider method is called "provider", but not "provide"?

2020-11-24 Thread Alex Orlov
>The provider() method returns an instance of a class that provides a >given service. provider() could be called serviceProvider() or >serviceImplementor() - but providor() suffices.   Following this logic we can change hashCode() in Object to provider(). Because it will return a value, that

Re[2]: Why service provider method is called "provider", but not "provide"?

2020-11-24 Thread Alex Orlov
Could you then explain the difference between service and service provider? As I understand you’re saying they are the same. I always thought, that they were two different things. For example, what we are talking about service factory/supplier/consumer we separate service from