5

ProgressMonitor has two constructors:

   public ProgressMonitor(Component parentComponent,
                           Object message,
                           String note,
                           int min,
                           int max) {
        this(parentComponent, message, note, min, max, null);
    }


    private ProgressMonitor(Component parentComponent,
                            Object message,
                            String note,
                            int min,
                            int max,
                            ProgressMonitor group) {

        this.min = min;
        this.max = max;
        this.parentComponent = parentComponent;

        cancelOption = new Object[1];
        cancelOption[0] = UIManager.getString("OptionPane.cancelButtonText");

        this.message = message;
        this.note = note;
        if (group != null) {
            root = (group.root != null) ? group.root : group;
            T0 = root.T0;
            dialog = root.dialog;
        }
        else {
            T0 = System.currentTimeMillis();
        }
    }

I don't see the reason for the second (private) constructor, where the only change in signature is ProgressMonitor group which is always null.
What am I missing ?

c0der
  • 18,467
  • 6
  • 33
  • 65
  • 3
    Maybe it's a leftover from some old code or it was meant to be extended and never was. You can go to openjdk and post a patch to remove it (along with the useless code that checks group != null – Guenther Sep 15 '16 at 10:43

0 Answers0