Hi Chris,

Thanks for having a look at my change:

>1) It seems awful to have to deal with LinkedList in native code. How
>    about returning an array from native, and then converting that into
>    whatever list type is appropriate at the Java level.
With the current implementation on Mac I do not know upfront how many items the 
list will contain and therefore I preferred to use the LinkedList from native 
code.
I can of course change the implementation on Mac to first generate a fully 
resolved native list and then I can use NewObjectArray to generate an Array of 
Proxy objects to return. This will avoid calling to java to add an element to 
the list. Do you think this will be better?

>2) I would prefer the use of List.of(...), and list.of() for empty, since
>    these are immutable and efficient list implementations.
I thought about that but I tried to not return an immutable List because the 
Javadoc of Proxy.select does not state anything about the returned List (if it 
is immutable or not) and I feared to break compatibility by returning an 
immutable List. 
If you think this is no problem I will of course prefer to always return the 
same immutable NO_PROXY list object.

>3) Is the comment “Inspired ...” necessary / appropriate?
I will change it to the comment proposed by Volker.

>4) Can some of the native initialization code be moved to a platform
>    independent location, to remove duplication?
Would it be ok if I move the definition of the static variables and the 
implementation of 'static int initJavaClass(...)' to a header file in the 
shared branch. I.e. src/java.base/shared/native/libnet/DefaultProxySelector.h 
and include this in the MacOSX, Windows and the Unix implementations?


>5) The new file has a shared copyright header. I see similar SAP
>    headers in a few files, but none shared with the Oracle header.
>    How did you arrive at this format?
The format was suggested to me by Volker :-)

Best regards,
Arno

Reply via email to