[OpenJDK 2D-Dev] RFR : 8200281: Add missing @Override annotations in ImageIO plugins

Alexey Ivanov alexey.ivanov at oracle.com
Wed Aug 5 21:49:32 UTC 2020

Hi Abhishek,


When @Override is added to anonymous classes, the annotation is not 
aligned to the method declaration; at time the indentation of the method 
declaration is unnecessarily modified:

1937             @Override
1938             public void imageProgress(ImageReader source,
in the original file
1927                 public void imageProgress(ImageReader source,

But it's not easy to see in the webrev because it ignored indent change 
on the lines 1927/1938.

These are misaligned and are seen clearly:
1946             @Override
1958             @Override
1964             @Override
1977             @Override
1988             @Override
1998             @Override

This changes the indentation of the method declaration:
1980             @Override
1981             public void thumbnailPassStarted(ImageReader source,

Missing @Override annotation:
2045                 public Boolean run() {

Since we're doing clean-up, a couple more warning can be addressed:

1. There are several unused imports which can be removed.

2. There are two wildcard imports:
   63 import java.io.*;
   64 import java.nio.*;
Shall we expand them into specific imports or leave as is?

3. The class can be made static:
2019     private class EmbeddedProgressAdapter implements 
IIOReadProgressListener {


Missing @Override annotation:
1348                     public void imageProgress(ImageWriter source, 
float percentageDone) {
1354                     public void warningOccurred(ImageWriter source, 
int imageIndex, String warning) {

The class can be made static:
1384     private class IIOWriteProgressAdapter implements 
IIOWriteProgressListener {


There are a couple unused imports which can be removed.


Missing @Override annotation:
   91                 public Void run() {
  953                     protected ImageTypeSpecifier produce() {
1811      public boolean hasNext() {
1825      public ImageTypeSpecifier next() {
1835      public void remove() {


Missing @Override annotation:
179                 public Void run() {


Missing @Override annotation:
76     public InputStream nextElement() {
86     public boolean hasMoreElements() {

This file has been updated since the time this webrev was created; thus 
the copyright update does not apply.


This file has a wildcard import:
43 import java.io.*;
Shall we expand it as in BMPImageReader.java?


Missing @Override annotation:
137     public boolean canWriteRasters() {


>> On 30 Jul 2020, at 07:10, Kumar Abhishek <kumar.z.abhishek at oracle.com> wrote:
>> Hi Dmitry,
>> I have updated the year in the copyright section for the modified file.
>> Please find the updated Webrev:-
>> http://cr.openjdk.java.net/~jdv/8200281/webrev.03/
>> Thanks,
>> Abhishek
>> <SNIP>
>> -----Original Message-----
>> From: Alexey Ivanov
>> Sent: Saturday, July 25, 2020 2:38 AM
>> To: Kumar Abhishek <kumar.z.abhishek at oracle.com>
>> Cc: Philip Race <philip.race at oracle.com>; 2d-dev
>> <2d-dev at openjdk.java.net>
>> Subject: Re: [OpenJDK 2D-Dev] RFR : 8200281: Add missing @Override
>> annotations in ImageIO plugins
>> Hi Abhishek,
>> <SNIP>
>> So the patch is incomplete.
>> Please verify you add @Override annotation to all overridden methods in these classes.
>> Regards,
>> Alexey

More information about the 2d-dev mailing list