JDK 9 RFR of 8031326: Use Class<?> rather than Class in java.net method signatures

Chris Hegarty chris.hegarty at oracle.com
Tue Jan 7 09:47:05 PST 2014


Approved.

-Chris.

On 7 Jan 2014, at 17:36, Joe Darcy <joe.darcy at oracle.com> wrote:

> Hello,
> 
> Please review these changes to remove use of raw Class in some method signatures in java.net:
> 
>        JDK-8031326: Use Class<?> rather than Class in java.net method signatures
> 
> Patch below.
> 
> Thanks,
> 
> -Joe
> 
> --- a/src/share/classes/java/net/URL.java    Tue Jan 07 09:17:56 2014 -0800
> +++ b/src/share/classes/java/net/URL.java    Tue Jan 07 09:20:09 2014 -0800
> @@ -1055,7 +1055,7 @@
>     /**
>      * Gets the contents of this URL. This method is a shorthand for:
>      * <blockquote><pre>
> -     *     openConnection().getContent(Class[])
> +     *     openConnection().getContent(classes)
>      * </pre></blockquote>
>      *
>      * @param classes an array of Java types
> @@ -1066,7 +1066,7 @@
>      * @see        java.net.URLConnection#getContent(Class[])
>      * @since 1.3
>      */
> -    public final Object getContent(Class[] classes)
> +    public final Object getContent(Class<?>[] classes)
>     throws java.io.IOException {
>         return openConnection().getContent(classes);
>     }
> diff -r b54fa34779b6 src/share/classes/java/net/URLConnection.java
> --- a/src/share/classes/java/net/URLConnection.java    Tue Jan 07 09:17:56 2014 -0800
> +++ b/src/share/classes/java/net/URLConnection.java    Tue Jan 07 09:20:09 2014 -0800
> @@ -1,5 +1,5 @@
> /*
> - * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
> + * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
>  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
>  *
>  * This code is free software; you can redistribute it and/or modify it
> @@ -760,7 +760,7 @@
>      * @see java.net.URLConnection#setContentHandlerFactory(java.net.ContentHandlerFactory)
>      * @since 1.3
>      */
> -    public Object getContent(Class[] classes) throws IOException {
> +    public Object getContent(Class<?>[] classes) throws IOException {
>         // Must call getInputStream before GetHeaderField gets called
>         // so that FileNotFoundException has a chance to be thrown up
>         // from here without being caught.
> 



More information about the net-dev mailing list