On 6/3/2016 7:58 PM, Sergey Bylokhov wrote:
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.
I did not understand what you meant under "extension" term
(inheritance?). It is not true that the method has the same spec.
Actually the spec describes the basic functionality. And GTK painter is
not a public API, so it is not required to provide any specs. If you
look on GTK painter implementation you can notice that the most of the
over-ridden methods doesn't correspond to Sinth painter specs. I don't
see the reason to change this as a part of this fix, especially that it
is not possible because of the reason I already told you.
I still did not get why an overload method should have the same behavior
as its associates. This is a brand new design principle I've never heard
before.