On Fri, Feb 15, 2019 at 5:31 PM Oleg Kalnichevski <[email protected]> wrote:

> On Fri, 2019-02-15 at 16:06 -0500, Gary Gregory wrote:
> > On Wed, Feb 6, 2019 at 7:49 PM Gary Gregory <[email protected]>
> > wrote:
> >
> > > Oleg and all:
> > >
> > > Would you please take a look
> > > at
> > > org.apache.hc.core5.http.impl.bootstrap.CustomAsyncServerBootstrap.
> > > createRequestHandlerRegistry()
> > > in the branch HTTPCORE-570.
> > >
> > > The TODO comment, I believe surfaces a mistake in our generic
> > > typing
> > > of RequestHandlerRegistry or at least that one ctor.
> > >
> > > IOW, why doesn't this compile in CustomAsyncServerBootstrap:
> > >
> > >         Supplier<LookupRegistry<AsyncServerExchangeHandler>>
> > > supplier =
> > > new Supplier<LookupRegistry<AsyncServerExchangeHandler>>() {...};
> > >         RequestHandlerRegistry<Supplier<AsyncServerExchangeHandler>
> > > >
> > > registry = new RequestHandlerRegistry<>(
> > >                 actualCanonicalHostName, supplier);
> > >
> > >
> >
> > Note the compiler warnings for callers
> > of
> > org.apache.hc.core5.http.protocol.RequestHandlerRegistry.RequestHandl
> > erRegistry(String,
> > Supplier<LookupRegistry<T>>)
> >
> > Gary
> >
>
> Hi Gary
>
> I see no warning neither in the IDE nor compiling with Maven
>
> [INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @
> httpcore5 ---
> [INFO] Toolchain in maven-compiler-plugin: JDK[/opt/oracle-jdk-1.7.0]
> [INFO] Changes detected - recompiling the module!
> [INFO] Compiling 472 source files to /home/oleg/src/
> apache.org/httpcomponents/httpcore-5.x/httpcore5/target/classes
> [WARNING] /home/oleg/src/
> apache.org/httpcomponents/httpcore-5.x/httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java:[212,16]
> <http://apache.org/httpcomponents/httpcore-5.x/httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java:%5B212,16%5D>
> [deprecation] lock() in IOSession has been deprecated
> [WARNING] /home/oleg/src/
> apache.org/httpcomponents/httpcore-5.x/httpcore5/src/main/java/org/apache/hc/core5/reactor/InternalDataChannel.java:[270,16]
> <http://apache.org/httpcomponents/httpcore-5.x/httpcore5/src/main/java/org/apache/hc/core5/reactor/InternalDataChannel.java:%5B270,16%5D>
> [deprecation] lock() in IOSession has been deprecated
> [WARNING] /home/oleg/src/
> apache.org/httpcomponents/httpcore-5.x/httpcore5/src/main/java/org/apache/hc/core5/reactor/IOSessionImpl.java:[93,16]
> <http://apache.org/httpcomponents/httpcore-5.x/httpcore5/src/main/java/org/apache/hc/core5/reactor/IOSessionImpl.java:%5B93,16%5D>
> [deprecation] lock() in IOSession has been deprecated
> [INFO]
>
>
This is what Eclipse says for one of the call sites:

Description Resource Path Location Type

LookupRegistry is a raw type. References to generic type LookupRegistry<T>
should be parameterized AsyncServerBootstrap.java
/httpcore5/src/main/java/org/apache/hc/core5/http/impl/bootstrap line 334 Java
Problem

Supplier is a raw type. References to generic type Supplier<T> should be
parameterized AsyncServerBootstrap.java
/httpcore5/src/main/java/org/apache/hc/core5/http/impl/bootstrap line 331 Java
Problem

Type safety: The expression of type new Supplier(){} needs unchecked
conversion to conform to
Supplier<LookupRegistry<Supplier<AsyncServerExchangeHandler>>>
AsyncServerBootstrap.java
/httpcore5/src/main/java/org/apache/hc/core5/http/impl/bootstrap line 331 Java
Problem

Gary

> Oleg
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to