On 03.06.16 18:57, Semyon Sadetsky wrote:
This is a public API, and it will be strange if two overloaded methods
behave differently.
I did not get it. Could you provide an example?

Something like this:
  JButton jb = new JButton();
  SynthUI ui = (SynthUI) jb.getUI();
  SynthContext context = ui.getContext(jb);
  SynthPainter painter = context.getStyle().getPainter(context);
  painter.paintTabbedPaneTabBorder(context, /*Graphics g*/ null, 0, 0,
10, 10, 1);
  painter.paintTabbedPaneTabBorder(context, /*Graphics g*/ null, 0, 0,
10, 10, 1, JTabbedPane.LEFT);

And what does this prove? What in this example does not allow to the
first painter.paintTabbedPaneTabBorder() call, without the orientation
argument, to have different behavior?

This is an answer to your question, it proof that this functionality can be accessed via public API. And it is strange that overloaded methods, which have the same spec, have different behaviour. before the fix all subclasses had the same implementation(useful code or noop). Actually the method with orientation flag was added in jdk6 as an extension of the first method.


--
Best regards, Sergey.

Reply via email to