<AWT Dev> RFR: 8259519: The java.awt.datatransfer.DataFlavor#ioInputStreamClass field is redundant

Sergey Bylokhov serb at openjdk.java.net
Mon Jan 11 00:14:57 UTC 2021


On Sun, 10 Jan 2021 19:55:02 GMT, Attila Szegedi <attila at openjdk.org> wrote:

>> A long time ago in the pre-1.0 era, this field was initialized via reflection since the "InputStream" class was optional. This was changed since then and a separate field to refer the "InputStream.class" is not needed.
>
> src/java.datatransfer/share/classes/java/awt/datatransfer/DataFlavor.java line 1160:
> 
>> 1158:      */
>> 1159:     public boolean isRepresentationClassInputStream() {
>> 1160:         return java.io.InputStream.class.isAssignableFrom(representationClass);
> 
> Suggestion:
> 
>         return InputStream.class.isAssignableFrom(representationClass);
> The class is already imported on line 32.

This is the style used by the various methods in this class to highlight an exact used type.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2016


More information about the awt-dev mailing list