JDK 9 RFR of JDK-8050798: New unchecked warning introduced in com.sun.jndi.ldap.Connection

Mandy Chung mandy.chung at oracle.com
Thu Jul 17 00:55:56 UTC 2014


Looks good.
Mandy

On 7/16/2014 5:24 PM, Joe Darcy wrote:
> Hello,
>
> Please review the patch below for
>
>     JDK-8050798: New unchecked warning introduced in 
> com.sun.jndi.ldap.Connection
>
> which addresses a newly-introduced unchecked warning in core libs.
>
> Thanks,
>
> -Joe
>
> diff -r e4a6f3779797 src/share/classes/com/sun/jndi/ldap/Connection.java
> --- a/src/share/classes/com/sun/jndi/ldap/Connection.java    Tue Jul 
> 15 11:22:14 2014 -0700
> +++ b/src/share/classes/com/sun/jndi/ldap/Connection.java    Wed Jul 
> 16 17:22:37 2014 -0700
> @@ -258,9 +258,9 @@
>
>              // create the factory
>
> +            @SuppressWarnings("unchecked")
>              Class<? extends SocketFactory> socketFactoryClass =
> -                    (Class<? extends SocketFactory>) 
> Obj.helper.loadClass
> -                    (socketFactory);
> +                (Class<? extends 
> SocketFactory>)Obj.helper.loadClass(socketFactory);
>              Method getDefault =
>                  socketFactoryClass.getMethod("getDefault", new 
> Class<?>[]{});
>              SocketFactory factory = (SocketFactory) 
> getDefault.invoke(null, new Object[]{});
>




More information about the core-libs-dev mailing list